打包python程序的方法-创新互联
创新互联www.cdcxhl.cn八线动态BGP香港云服务器提供商,新人活动买多久送多久,划算不套路!
这篇文章主要介绍打包python程序的方法,文中介绍的非常详细,具有一定的参考价值,感兴趣的小伙伴们一定要看完!
将Python程序打包为exe文件,需要使用到的工具是pyinstaller
pyinstaller是一个多平台的Python程序打包为exe的免费工具
安装pyinstaller:
1,在Windows中,pyinstaller依赖PyWin32,pypiwin32(Linux,mac忽略)
如果在安装pyinstaller时使用的是pip或者easy_install会自动pypwin32,只需要手动安装Pywin32即可
安装命令:pip install pywin32
2,使用pip安装pyinstaller
安装命令:pip install PyInstaller
如果安装环境没有网络不能使用pip安装,可以去官网http://www.pyinstaller.org/ ,下载安装。
注意:手动安装需要安装pypiwin32
3,pyinstaller的使用
打包命令:pyinstaller -F py文件路径;
打包成功后dist文件夹下就是exe了;
提示:-i 可以替换默认ico图标;
命令:pyinstaller -F -i ico图片路径 py文件路径。
以上是打包python程序的方法的所有内容,感谢各位的阅读!希望分享的内容对大家有帮助,更多相关知识,欢迎关注创新互联-成都网站建设公司行业资讯频道!
当前文章:打包python程序的方法-创新互联
URL网址:http://azwzsj.com/article/depsei.html