Skip to content

Instantly share code, notes, and snippets.

@mike-zhang
Created November 17, 2012 06:03
Show Gist options
  • Save mike-zhang/4093716 to your computer and use it in GitHub Desktop.
Save mike-zhang/4093716 to your computer and use it in GitHub Desktop.
py2exe简单示例
'''
fileName : build.py
usage : build.py py2exe
'''
from distutils.core import setup
import py2exe
import sys
includes = ["encodings", "encodings.*"]
sys.argv.append("py2exe")
options = {"py2exe":{
"ascii": 1, # to make a smaller executable, don't include the encodings
"compressed": 1, # compress the library archive
"bundle_files": 1,
"includes": includes,
}
}
setup(options = options,
zipfile=None,
console = [{"script":'test1.py',
}],
data_files = ["Microsoft.VC90.CRT.manifest","msvcr90.dll"],
)
'''
for Python 2.7
Microsoft.VC90.CRT.manifest :
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<noInheritable></noInheritable>
<assemblyIdentity type="win32" name="Microsoft.VC90.CRT" version="9.0.21022.8" processorArchitecture="x86" publicKeyToken="1fc8b3b9a1e18e3b"></assemblyIdentity>
<file name="msvcr90.dll" />
</assembly>
'''
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment