Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Py2exe + PythonCard compiled script crashes

Reply
Thread Tools

Py2exe + PythonCard compiled script crashes

 
 
HuFlungDu HuFlungDu is offline
Junior Member
Join Date: Jul 2010
Posts: 1
 
      07-28-2010
Hey all, as the thread title suggests, I am having some problems with compiling a script into a native windows executable. Basically, I can compile and run just fine if I do not use the bundle option. However, upon activating the bundle option, the program will crash with a non-descript error (i.e. [program] "has encountered a problem and needs to close. We are sorry for the inconvenience.") Basically I would like to know why this happens and if there is any known way to fix it, or if I am doomed to distribute my application with ~15 extra files? Here's the setup script if it helps (I doubt it):

Code:
from distutils.core import setup
import py2exe
import sys
import os

filename = "File.py"
 

if filename.endswith(".py"):
    distribution = "File"
elif filename.endswith(".pyw"):
    distribution = filename[:-4]
 

if len(sys.argv) == 1:
    sys.argv.append("py2exe")
    sys.argv.append("-q")
includes=[]
for comp in ['button','image','staticbox',\
            'statictext','textarea','textfield','passwordfield','bitmapcanvas',\
             'radiogroup','choice','checkbox']:
    includes += ['PythonCard.components.'+comp]

pycard_resources=["File.rsrc.py"]
for filename in os.listdir('.'):
    if filename.find('.rsrc.')>-1:
        pycard_resources+=[filename]
dest_file = "File"  # Final name of .exe file
dest_folder = "Folder"
opts = { 'py2exe': { 'includes':includes,
                     "compressed": 1,
                     "optimize": 2,
                     "bundle_files": 1,
                     "ascii": 1,
                     "dist_dir": dest_folder,}}


setup(name='File',
    version='1.0',
    url='about:none',
    author='HuFlungDu',
    package_dir={'blarg':'.'},
    packages=['blarg'],
    data_files=[('.',pycard_resources)],
    console=['File.py'],
    options=opts,
    zipfile = None,
    )
Then I run it with this in a BAT file:

Code:
wx2exeZ.py py2exe --excludes=Image
@pause
I've looked around the net and haven't found any solutions to this problem, so I resorted to asking the question myself, hence this thread right here. Let me know if any additional info is required for you to understand my problem.

(Of possible note: I can assemble "Hello World" with bundled files, it's just when I use python card that it has problems)

Edit: Oh yeah, I forgot to mention: If there is no way to do this with py2exe, is there a better exe creator (such as pyinstaller) that would be able to do this for me? What would you recommend?
 

Last edited by HuFlungDu; 07-28-2010 at 05:48 AM..
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
PythonCard and Py2Exe PipedreamerGrey Python 2 02-26-2005 04:19 PM
PythonCard and Py2Exe PipedreamerGrey Python 0 02-22-2005 08:46 PM
PythonCard and Py2Exe PipedreamerGrey Python 0 02-22-2005 08:36 PM
PythonCard and Py2Exe PipedreamerGrey@yahoo.com Python 8 02-18-2005 09:26 AM
g++ compiled C++ code called from gcc compiled C code Klaus Schneider C++ 1 12-02-2004 01:44 PM



Advertisments