hello.py
C:Tutorial>python hello.py Hello World! C:Tutorial>
C:Tutorial>python setup.py install
- 在py2exe 下工作时,我们通常需要的 Distutils 的唯一部分就是 setup 函数,所以我们导入它。
- 一旦Distutils 加载完成,我们还需要加载 py2exe 以至于加载它的命令。
- 空一行总是好的!
- 调用 setup 告诉它我们想要一个单控制台应用程序,并且主入口是 "hello.py"。
C:Tutorial>python setup.py py2exe running py2exe * searching for required modules * * parsing results * creating python loader for extension 'zlib' creating python loader for extension 'unicodedata' creating python loader for extension 'bz2' * finding dlls needed * * create binaries * * byte compile python files * byte-compiling C:Tutorialbuildbdist.win32winexe empbz2.py to bz2.pyc byte-compiling C:Tutorialbuildbdist.win32winexe empꋸdedata.py to unicodedata.pyc byte-compiling C:Tutorialbuildbdist.win32winexe empzlib.py to zlib.pyc skipping byte-compilation of c:Python24libStringIO.py to StringIO.pyc [skipping many lines for brevity] skipping byte-compilation of c:Python24libwarnings.py to warnings.pyc * copy extensions * * copy dlls * copying c:Python24libsite-packagespy2exe un.exe -> C:Tutorialdisthello.exe * binary dependencies * Your executable(s) also depend on these dlls which are not included, you may or may not need to distribute them. Make sure you have the license if you distribute any of them, and make sure you don't distribute files belonging to the operating system. ADVAPI32.dll - C:WINDOWSsystem32ADVAPI32.dll USER32.dll - C:WINDOWSsystem32USER32.dll SHELL32.dll - C:WINDOWSsystem32SHELL32.dll KERNEL32.dll - C:WINDOWSsystem32KERNEL32.dll C:Tutorial>
C:Tutorial>cd dist C:Tutorialdist>hello.exe Hello World
版权声明:
本文来源网络,所有图片文章版权属于原作者,如有侵权,联系删除。
本文网址:https://www.mushiming.com/mjsbk/3040.html