安装PyInstaller:
pip install pyinstaller
打包程序:
使用PyInstaller将你的Python脚本打包成exe文件。假设你的脚本名为your_script.py,在命令行中运行:
pyinstaller --onefile your_script.py
这个命令会生成一个单独的exe文件。
如果打包的程序需要关闭控制台窗口,你可以使用以下命令:
pyinstaller --noconsole your_script.py
如果存在多个关系文件或者隐藏模块
pyinstaller --onefile --hidden-import=txt --hidden-import=requests .\waigua-v1.py
浙公网安备 33010602011771号