python3以上版本打包exe需要扩展软件:
下载地址:
1)安装后在\python32\scripts\cxfreeze.bat和\python32\scripts\cxfreeze-quickstart.bat文件中更改python实际路径,如:
c:\python32\python.exe c:\python32\scripts\cxfreeze %*改为d:\python32\python.exe d:\python32\scripts\cxfreeze %*
2)新建py2exe.bat,写入:
@echo off
@cd /d "%~dp0"
d:/python32/scripts/cxfreeze %1 --target-dir=d:\py2exe --base-name=win32gui
将需打包的py脚本拖入批处理即可,打包生成文件(exe文件)在target-dir即d:\py2exe下