Skip to content

常用代码

python
# 查看版本
python --version
# 列出已安装包
pip list
# 显示包信息
pip show pyinstaller
# 直接运行
python main.py

PyInstaller打包

python
# 安装
pip install pyinstaller
# 打包单个文件
pyinstaller your_script.py
# 打包为单文件(推荐)
pyinstaller --onefile your_script.py
# 打包并隐藏控制台窗口(适合GUI应用)
pyinstaller --onefile --windowed your_script.py