Created
October 31, 2013 13:53
-
-
Save zhuzhuor/7250173 to your computer and use it in GitHub Desktop.
use py2exe to generate a standalone exe file from python script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
try: | |
import py2exe | |
except: | |
raw_input('Please install py2exe first...') | |
sys.exit(-1) | |
from distutils.core import setup | |
import shutil | |
sys.argv.append('py2exe') | |
setup( | |
options={ | |
'py2exe': {'bundle_files': 1, 'compressed': True} | |
}, | |
console=[ | |
{'script': "my_program.py"} | |
], | |
zipfile=None, | |
) | |
shutil.move('dist\\my_program.exe', '.\\my_program.exe') | |
shutil.rmtree('build') | |
shutil.rmtree('dist') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
why this extra text is shown in exe file before actual execution?