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下