pyinstaller打包python脚本成可执行的exe文件。
步骤如下:
1.官网下载对应的pyinstall 工具, 我下载的是 pyinstaller-3.2.1.zip 并解压
2.通过cmd 跳转到pyinstaller目录 并执行 setup.py install 进行安装. 这时会向你的python路径安装必要的第三方包,当然细节可以不用关心
3. 安装成功后 就可以使用了。
tk-gui.py是我的源程序
c:\pyinstaller-3.2.1>pyinstaller.py -f -w c:\users\han.chunwang\pycharmprojects\
untitled\tk-gui.py
.....
62186 info: checking exe
62186 info: building exe because out00-exe.toc is non existent
62186 info: building exe from out00-exe.toc
62187 info: appending archive to exe c:\pyinstaller-3.2.1\dist\tk-gui.exe
62194 info: building exe from out00-exe.toc completed successfully.
-f 是生成exe 程序, 因为我使用tkinter编译的gui程序 还需要指定-w 参数 后面是路径,
打包有个过程 稍等片刻后,就会在pyinstaller目录生成一个exe程序。
以上就是python自带打包exe的库吗的详细内容。