Cxfreeze使用
cx_Freeze-5.1.1-cp36-cp36m-win_amd64.wh
1● 打包多个文件
Cxfreeze D:/test.py –target-dir D:/ |
cmd使用 管理员打包
cxfreeze D:\pyspace\pyChapter1\test\formTest.py --target-dir %desk%/aa
2● 打包单个文件
cxfree D:/text.py –target-dir D:/ --no-copy-deps |
cxfreeze D:\pyspace\pyChapter1\test\formTest.py --target-dir %desk%/aa –no-copy-deps
3● setup.py配置
|
import sysfrom cx_Freeze import setup, Executable # Dependencies are automatically detected, but it might need fine tuning. build_exe_options = {"packages": ["os"], "excludes": ["tkinter"]} # GUI applications require a different base on Windows (the default is for a console application). base = None if sys.platform == "win32": base = "Win32GUI" setup( name = "guifoo", version = "0.1", description = "My GUI application!", options = {"build_exe": build_exe_options}, executables = [Executable("guifoo.py", base=base)] )
|
D:\pyspace\pyChapter1\test\formTest.py |
from cx_Freeze import setup, Executable # Dependencies are automatically detected, but it might need import sys executables = [ setup(name='xxx', |
4● 配置快捷路径
des |
/d C:\Users\Administrator\Desktop |
|
/d D:\home\user\tencent\qq\file |
desk |
%userprofile%\desktop |
目前就只能用 一个 命令 cxfreeze test.py –target-dir dist |