user961124
user961124

Reputation: 121

Py2exe bundling files into a single exe

I'm having some trouble getting Py2exe to bundle all the files into a single .exe. It works fine for me when I don't bundle them together. So this is the setup.py script I use when I'm not bundling them together, and it always works:

from distutils.core import setup
import py2exe
setup(console=['test.py'])

So I wanted to bundle all the files into a single executable, so I used this setup.py script for that, and this is the one that doesn't work:

from distutils.core import setup
# I took this off the Internet
import py2exe, sys, os
sys.argv.append('py2exe')
setup(
    options = {'py2exe': {'bundle_files': 1}},
    windows = [{'script': "test.py"}],
    zipfile = None,
)

When I run this script, a dist directory is created with the test.exe file. If I execute it by typing "test.exe" this error message pops up:

See the logfile 'c:\Python26\dist\test.ext.log' for details

And this is the contents of that logfile:

Traceback (most recent call last):
File "test.py", line 1, in <module>
EOFError: EOF when reading a line

So does anyone know how I can do this? I just want to bundle all the files Py2exe generates with test.py into a single executable. I know it can do this. Or are there any other ways in which this can be done?

Upvotes: 2

Views: 937

Answers (1)

Remi
Remi

Reputation: 21175

just from the errorlog message, could you try again after assuring the last line of test.py ends with a carriage return? (press enter after the last line in test.py and save again)

Upvotes: 0

Related Questions