- 浏览: 296423 次
- 性别:
- 来自: 北京
文章分类
- 全部博客 (98)
- philosophy (0)
- python (21)
- mac (6)
- linux (12)
- vfx (8)
- web2.0 (2)
- win (2)
- java (2)
- it (1)
- ruby (1)
- gtd (6)
- digest (1)
- maya (1)
- sns (1)
- dip (2)
- ldap (1)
- eclipse (1)
- mba (1)
- lisp (2)
- haskell (3)
- life (4)
- c# (1)
- c++ (3)
- sci-fi (1)
- news (2)
- poem (2)
- reading (2)
- mysql (1)
- coffee (0)
- houdini (1)
- economics (1)
- emacs (1)
- render (1)
- expect (0)
- shake (1)
最新评论
-
aib628:
真是好东东,正在学习中!
Jython 简单入门 -
jiguanghover:
不错的例子,好好看看
Jython 简单入门 -
rmn190:
不错, 现在正在从Java转到Python这边来, 以前用Ja ...
Jython 简单入门 -
kandari:
有没有openSUSE的
用NTP网络时间协议同步你的IT系统 -
CharlesCui:
winmail.dat是个垃圾!气死我了.
如何提取 winmail.dat ?
py2exe是一个可以把python脚本转成windows下的可执行程序的模块。
py2exe扩展自disutils模块,由查看C:\Python25\Lib\site-packages\py2exe\__init__.py文件可知:
简单的使用方式如下:
1. 创建一个python脚本hello.py
2. 在同目录下创建一个setup.py脚本
3. 运行setup.py,通常参数是install,现在是py2exe
4. 你要的exe文件出现了
py2exe扩展自disutils模块,由查看C:\Python25\Lib\site-packages\py2exe\__init__.py文件可知:
""" builds windows executables from Python scripts New keywords for distutils' setup function specify what to build: console list of scripts to convert into console exes windows list of scripts to convert into gui exes service list of module names containing win32 service classes com_server list of module names containing com server classes ctypes_com_server list of module names containing com server classes zipfile name of shared zipfile to generate, may specify a subdirectory, defaults to 'library.zip' py2exe options, to be specified in the options keyword to the setup function: unbuffered - if true, use unbuffered binary stdout and stderr optimize - string or int (0, 1, or 2) includes - list of module names to include packages - list of packages to include with subpackages ignores - list of modules to ignore if they are not found excludes - list of module names to exclude dll_excludes - list of dlls to exclude dist_dir - directory where to build the final files typelibs - list of gen_py generated typelibs to include (XXX more text needed) Items in the console, windows, service or com_server list can also be dictionaries to further customize the build process. The following keys in the dictionary are recognized, most are optional: modules (SERVICE, COM) - list of module names (required) script (EXE) - list of python scripts (required) dest_base - directory and basename for the executable if a directory is contained, must be the same for all targets create_exe (COM) - boolean, if false, don't build a server exe create_dll (COM) - boolean, if false, don't build a server dll bitmap_resources - list of 2-tuples (id, pathname) icon_resources - list of 2-tuples (id, pathname) other_resources - list of 3-tuples (resource_type, id, datastring) """ # py2exe/__init__.py # 'import py2exe' imports this package, and two magic things happen: # # - the 'py2exe.build_exe' submodule is imported and installed as # 'distutils.commands.py2exe' command # # - the default distutils Distribution class is replaced by the # special one contained in this module. # __version__ = "0.6.8" import distutils.dist, distutils.core, distutils.command, build_exe, sys class Distribution(distutils.dist.Distribution): def __init__(self, attrs): self.ctypes_com_server = attrs.pop("ctypes_com_server", []) self.com_server = attrs.pop("com_server", []) self.service = attrs.pop("service", []) self.windows = attrs.pop("windows", []) self.console = attrs.pop("console", []) self.isapi = attrs.pop("isapi", []) self.zipfile = attrs.pop("zipfile", "library.zip") distutils.dist.Distribution.__init__(self, attrs) distutils.core.Distribution = Distribution distutils.command.__all__.append('py2exe') sys.modules['distutils.command.py2exe'] = build_exe
简单的使用方式如下:
1. 创建一个python脚本hello.py
print 'hello'
2. 在同目录下创建一个setup.py脚本
from distutils.core import setup import py2exe setup(console=['hello.py']
3. 运行setup.py,通常参数是install,现在是py2exe
python setup.py py2exe
4. 你要的exe文件出现了
cd dist ./hello.exe
发表评论
-
用python ctypes调用动态链接库
2009-10-12 15:10 6960ctypes is very cool! Great piec ... -
MoinMoin 1.5.8 上传附件的XMLRPC API实现
2009-09-22 16:44 2510一、服务端 1. 修改/usr/lib/python2.5/ ... -
用python实现SSH的免密码输入访问客户端
2009-07-10 09:52 83811. pexpect - http://pexpect.sou ... -
为心爱的MoinMoin写一个小小的Done宏
2009-04-15 16:04 1480############################# ... -
根据CSV文件自动形成表格的MoinMoin插件——InsertCSV
2009-02-28 00:34 3061MoinMoin本身的制表语法很简单,但是如果其他软件制作好的 ... -
使用appscript+python来控制Mac下的GUI应用程序
2009-02-15 13:28 8566在Mac下,appscript是一个与应用程序通信交互的强大工 ... -
PyFileMaker介绍
2009-02-15 11:57 1368PyFileMaker是一个用于访问和修改FileMaker ... -
如何将.py编译成.pyc/.pyo文件
2009-02-10 15:14 3740使用方式如下: python -O -m py_com ... -
Darwin Calendar Server,一个开放源代码的日历服务器
2009-02-06 19:18 3837Darwin Calendar Server是一个 ... -
VObject
2009-02-06 00:23 1127VObject VObject simplifies t ... -
python library extra
2009-02-06 00:18 9411. dateutil - The dateutil modu ... -
Epydoc
2009-02-05 12:15 1002http://epydoc.sourceforge.net/ ... -
一则魅族M8下歌词乱码的程序小故事
2009-01-20 00:41 2218最近,一朋友买了个魅族的M8手机,整天拨弄,爱不释手。一次找我 ... -
Jython 简单入门
2008-12-30 19:38 370481. 用Jython调用Java类库 第一步、创建Java类 ... -
readline
2008-12-02 23:33 1122There are two ways to configure ... -
feedparser学习摘要
2008-10-13 01:22 2929号称Universal Feed Parser,通吃所有合法不 ... -
13.4 shelve -- Python object persistence
2008-10-05 02:22 1181import shelve d = shelve.o ... -
python相关拾零
2008-09-09 16:51 661* python-psycopg2 - Python modu ... -
getopt -- Parser for command line options
2008-08-27 12:56 1162getopt -- Parser for command li ... -
TurboGears 和 Django 的比较
2008-08-21 22:50 7489TurboGears 和 Django 的比较 ...
相关推荐
将自己写的python文件压缩成exe有两种方法: 1、使用pyinstaller 将自己写的python文件压缩成exe有两种方法: 1、使用pyinstaller step2:cd 到你的文件目录cd D:\py\python testcases\Slice step4:看结果...
py2exe是一个将python脚本转换成windows上的可独立执行的可执行程序(*.exe)的工具,这样,你就可以不用装python而在windows系统上运行这个可执行程序。 py2exe已经被用于创建wxPython,Tkinter,Pmw,PyGTK,pygame,win...
py2exe是一个将python脚本转换成windows上的可独立执行的可执行程序(*.exe)的工具,就可以不用装python而在windows系统上运行这个可执行程序。这里提供python 2.7, python3.3, python3.4 32位和64位的下载。
如何将Python脚本打包成可执行的exe文件#520表白代码 我们开发的脚本一般都会用到一些第三方包,可能别人也需要用到我们的脚本,如果我们将我们的xx.py文件发给他,他是不能直接用的,他还需要安装python解释器,...
unpy2exe.py可以从py2exe生成的exe中还原pyc文件, 适用于反编译py2exe程序。 程序使用pefile模块解析exe文件; 使用marshal模块生成pyc文件数据, 得到提取后的pyc文件。 其中还附带了py2exe_con.py和py2exe_w.py, ...
py2exe是一个将python脚本转换成windows上的可独立执行的可执行程序(*.exe)的工具,这样,你就可以不用装python而在windows系统上运行这个可执行程序。
py2exe是一个将python脚本转换成windows上的可独立执行的可执行程序(*.exe)的工具,这样,你就可以不用装python而在windows系统上运行这个可执行程序。 py2exe已经被用于创建wxPython,Tkinter,Pmw,PyGTK,pygame,...
将Python脚本文件包装成可执行文件,其目的有二: 一则: 不需要依赖Python编译器就可以运行软件 二则: 不想让自己的源码公布出去 常用的工具有: py2exe、cx_freeze等 【工具:py2exe】 安装py2exe 安装该工具很简单: ...
2、代码隐藏:Auto-py-to-exe允许将所有Python脚本和依赖项打包到一个独立的可执行文件中,使得用户无法直接访问或修改脚本。这有助于保护知识产权,并使代码更难以被非授权人员篡改。 3、可定制化选项:Auto-py-to-...
《赋予你的Python项目新生命:打包为独立可执行文件(exe)的简单步骤》 Python是一种解释型语言,通常不需要打包成可执行文件。但是,如果你想将你的Python代码部署到其他计算机上,或者想在没有安装Python解释器的...
py2exe是一个将python脚本转换成windows上的可独立执行的可执行程序(*.exe)的工具,这样,你就可以不用装python而在windows系统上运行这个可执行程序。
Python 脚本可自动执行 Simulia Abaqus 日常使用中的枯燥工作,从打开 GUI 到控制参数分析。 启动 Abaqus CAE open_abaqus.bat 启动 Abaqus CAE 并调用 open_abaqus.py 脚本。您可以为 bat 文件创建一个链接并将其...
py2exe是一个将python脚本转换成windows上的可独立执行的可执行程序(*.exe)的工具,这样,你就可以不用装python而在windows系统上运行这个可执行程序。 py2exe已经被用于创建wxPython,Tkinter,Pmw,PyGTK,pygame,win...
在Python中,可以使用打包工具将代码和依赖项打包成可执行的文件。下面是一些常见的Python打包工具: ...py2exe:py2exe是一个针对Windows平台的Python打包工具,可以将Python脚本和依赖项打包成Windows可执行文件。
py2exe适用于Python 3 py2exe是distutils扩展,它允许从Python脚本构建独立的Windows可执行程序(32位和64位)。 支持官方开发周期中包含的Python版本(从3.6到3.9)。 py2exe可以构建控制台可执行文件和Windows...
QPT - Python程序模块化封装工具(Py转EXE...QPT是一款可以“模拟”开发环境的多功能封装工具,最短只需一行命令即可将普通的Python脚本打包成EXE可执行程序,并选择性添加CUDA和NoAVX的支持,尽可能兼容更多的用户环境
今天闲着无事,写了一个小小的Python脚本程序,然后给同学炫耀的时候,发现每次都得拉着其他人过来看着自己的电脑屏幕,感觉不是很爽,然后我想着网上肯定有关于Python脚本转换成可执行文件的操作,事不宜迟,我就...
可以作为大数据预处理的MapReduce代码的参考!!! -执行脚本文件: cd /home/hadoop/logfiles/ source format_run_2013_o5_30.sh source format_run_2013_o5_31.sh 执行我们的脚本文件,可以用source或者./
py2exe是一个将python脚本转换成windows上的可独立执行的可执行程序(*.exe)的工具,这样,你就可以不用装python而在windows系统上运行这个可执行程序。 py2exe已经被用于创建wxPython,Tkinter,Pmw,PyGTK,pygame...