Python代码转换为exe可执行程序

1.安装pyInstaller,解压到指定目录下:
http://www.pyinstaller.org/downloads.html

2.下载一个pywin32,注意选择与Python版本对应的:
https://sourceforge.net/projects/pywin32/files/pywin32/

3.双击pywin32-221.win-amd64-py3.6.exe安装

4.在CMD命令行进入Python3.6目录下的Scripts目录并执行:python pywin32_postinstall.py -install

5.在CMD命令行中进入D:\Python\pyinstaller-pyinstaller目录,然后执行:python setup.py install

6.在CMD命令行进入该目录,并执行命令:python pyinstaller.py -F hello.py

7.生成了一个新目录D:\Python\pyinstaller-pyinstaller\hello
在该目录的dist文件夹下生成了一个hello.exe

猜你喜欢

转载自www.cnblogs.com/lljboke/p/12731780.html