怎么上传自己的网站,dede网站地图xml,西安做商铺的网站,棋牌网站怎么做优化python脚本如果在没有安装python的机器上不能运行#xff0c;所以将脚本打包成exe文件#xff0c;降低脚本对环境的依赖性#xff0c;同时运行更加迅速。当然打包的脚本似乎不是在所有的win平台下都能使用#xff0c;win7有一部分不能使用#xff0c;我在win10能够很好的运…python脚本如果在没有安装python的机器上不能运行所以将脚本打包成exe文件降低脚本对环境的依赖性同时运行更加迅速。当然打包的脚本似乎不是在所有的win平台下都能使用win7有一部分不能使用我在win10能够很好的运行。
准备工作 pyinstallerhttp://www.pyinstaller.org/ 首先还是去官网看支持的python版本不然会很尴尬的 可以直接在python环境使用命令pip install pyinstaller 会自动下载future,pywin32,pyinstaller pyinstaller相关参数 如何使用Pyinstaller 1.cmd到python的scripts 找到pyinstaller.exe 本人D:\zengSoftware\Anaconda\Scripts 2.输入命令 pyinstaller.exe -F demo.py 比如pyinstaller.exe -F F:\PythonProject\PythonLession\BaseFunction\translater.py
从cmd最后一行输出可查找到生成的文件D:\zengSoftware\Anaconda\Scripts\dist\translater.exe 如果想要对程序设置自定义图标pyinstaller -F -i ico_path py_path 首先需要下载一张正常的ico不能用直接修改后缀的。 下载图片https://www.easyicon.net 输入命令pyinstaller -F -i F:\PythonProject\PythonLession\BaseFunction\images\net.ico F:\PythonProject\PythonLession\BaseFunction\translater.py