pyinstaller打包常用参数解释

pyinstaller打包常用参数解释

━━━━━━━━━━━━━━━━━━━━━━
-F 或 --onefile 打包成单个可执行文件(.exe)
-w 或 --windowed 不显示控制台窗口(适用于 GUI 程序)
-c 或 --console 显示控制台窗口(默认,适用于命令行程序)
-n NAME 或 --name NAME 指定生成的可执行文件名称
━━━━━━━━━━━━━━━━━━━━━━
pyinstaller -F -w app.py # 打包成单个.exe,不显示控制台
pyinstaller -F -c app.py # 打包成单个.exe,显示控制台
━━━━━━━━━━━━━━━━━━━━━━

rem python打包_GUI

rem 打包成单个.exe,不显示控制台,适用于GUI程序
rem pyinstaller -F -w %1

pyinstaller --onefile --windowed %1
━━━━━━━━━━━━━━━━━━━━━━

rem python打包_控制台

rem 打包成单个.exe,显示控制台,适用于控制台程序
rem pyinstaller -F -c %1

pyinstaller --onefile --console %1

posted @ 2025-12-16 14:36  nxhujiee  阅读(10)  评论(0)    收藏  举报