本教程提取了pyinstaller官方文档部分内容并加以翻译, 希望给初学者一点指导, 仅供参考
- 安装pyinstaller:
pip install pyinstaller
https://pyinstaller.readthedocs.io/en/stable/usage.html
想看例子往后翻
--------正文开始--------
使用pyinstaller的命令格式是:
pyinstaller [options] script [script …] | specfile
初级用法,不编辑.spec文件
pyinstaller [options] script
最简单的情况下, 在命令行中切换到你的脚本myscript.py
所在的目录后, 执行
pyinstaller myscript.py
即可
pyinstaller会分析你的代码myscript.py
并且:
- 在脚本所在目录下创建