py2exe是什么
来源:互联网 发布:linux 防止ip欺骗 编辑:程序博客网 时间:2024/04/29 21:06
py2exe是什么?py2exe是一种python发布工具,可以把python脚本转换成windows下的可执行程序,不需要安装python便可运行。py2exe现在可以用来创建使用了wxPython, Tkinter, Pmw, PyGTK, pygame, win32com client and server 等模块的程序。详细介绍可以看它的官方网站 http://starship.python.net/crew/theller/py2exe/1. 下载安装py2exepy2exe目前的版本是0.5.4,根据你安装的python的版本选择下载的文件py2exe-0.5.4.win32-py2.3.exe或py2exe-0.5.4.win32-py2.4.exe安装后的文件应该在你的python安装目录下的Lib/site-packages/py2exe2. 使用py2exe我们先准备一个简单的python程序hello.py然后为使用py2exe写一个脚本setup.py运行setup.py,记得要传一个参数给它应该看到一些输出信息py2exe会在当前目录下生成两个目录 build和distbuild里是一些py2exe运行时产生的中间文件,dist里有最终的可执行文件library.zipw9xpopen.exepython23.dllhello.exe现在可以运行hello.exe了不过记得如果要发布到别的机器上时,library.zip、 w9xpopen.exe、python23.dll这几个文件是必须要和hello.exe在一起的。好了,这次先到这里,下次我们做一个wxPython的例子最后,大家试试运行看看py2exe都有哪些参数
[Copy to clipboard] [ - ]
CODE:# hello.pydef main(): print "Hello, World!"if __name__ == '__main__': main()
[Copy to clipboard] [ - ]
CODE:# setup.pyfrom distutils.core import setupimport py2exe setup(console=["hello.py"])
[Copy to clipboard] [ - ]
CODE:python setup.py py2exe
QUOTE:
running py2execreating E:/Projects/WorkSpace/Python/buildcreating E:/Projects/WorkSpace/Python/build/bdist.win32creating E:/Projects/WorkSpace/Python/build/bdist.win32/winexecreating E:/Projects/WorkSpace/Python/build/bdist.win32/winexe/collectcreating E:/Projects/WorkSpace/Python/build/bdist.win32/winexe/tempcreating E:/Projects/WorkSpace/Python/dist*** searching for required modules ****** parsing results ***creating python loader for extension '_sre'*** finding dlls needed ****** create binaries ****** byte compile python files ***byte-compiling C:/Python23/lib/copy_reg.py to copy_reg.pycbyte-compiling C:/Python23/lib/sre_compile.py to sre_compile.pycbyte-compiling E:/Projects/WorkSpace/Python/build/bdist.win32/winexe/temp/_sre.py to _sre.pycbyte-compiling C:/Python23/lib/macpath.py to macpath.pycbyte-compiling C:/Python23/lib/popen2.py to popen2.pycbyte-compiling C:/Python23/lib/atexit.py to atexit.pycbyte-compiling C:/Python23/lib/os2emxpath.py to os2emxpath.pycbyte-compiling C:/Python23/lib/sre_constants.py to sre_constants.pycbyte-compiling C:/Python23/lib/re.py to re.pycbyte-compiling C:/Python23/lib/ntpath.py to ntpath.pycbyte-compiling C:/Python23/lib/stat.py to stat.pycbyte-compiling C:/Python23/lib/string.py to string.pycbyte-compiling C:/Python23/lib/warnings.py to warnings.pycbyte-compiling C:/Python23/lib/UserDict.py to UserDict.pycbyte-compiling C:/Python23/lib/repr.py to repr.pycbyte-compiling C:/Python23/lib/copy.py to copy.pycbyte-compiling C:/Python23/lib/types.py to types.pycbyte-compiling C:/Python23/lib/posixpath.py to posixpath.pycbyte-compiling C:/Python23/lib/sre.py to sre.pycbyte-compiling C:/Python23/lib/linecache.py to linecache.pycbyte-compiling C:/Python23/lib/sre_parse.py to sre_parse.pycbyte-compiling C:/Python23/lib/os.py to os.pyc*** copy extensions ***copying C:/Python23/DLLs/_sre.pyd ->; E:/Projects/WorkSpace/Python/dist*** copy dlls ***
[Copy to clipboard] [ - ]
CODE:E:/Projects/WorkSpace/Python/dist>;helloHello, World!
[Copy to clipboard] [ - ]
CODE:python setup.py py2exe --help
- py2exe是什么
- py2exe
- py2exe
- py2exe
- py2exe
- py2exe
- py2exe
- py2exe
- Py2exe
- py2exe
- use py2exe
- py2exe 簡介
- py2exe使用方法
- py2exe簡介
- py2exe打包
- Py2exe使用方法
- py2exe使用方法
- py2exe使用方法
- asp如何调用不在同一驱动器上的数据库??
- asp如何调用不在同一驱动器上的数据库??
- 我要走的路
- 很不错的10句话
- asp如何调用不在同一驱动器上的数据库??
- py2exe是什么
- Quartz调度框架应用总结
- 笑谈十大绿帽子帝王
- 徐静蕾2008十大青春语录
- nested exception is java.lang.IllegalAccessError: tried to access method net.sf.ehcache.CacheManager.()V from class org.hibernat
- 2008年6月16日--重出江湖2年了,找个豪迈的词做标题^^
- Dialect does not support sequences
- JAVA Application初步
- 带参数方法和存储过程