从.py创建exe文件

时间:2018-06-09 16:34:11

标签: python module exe

我有一个python程序,它有3个模块.py。

我该怎么做才能创建这个程序的exe格式?

我尝试使用pyinstaller,但那会为我的主.py和其他.py

创建exe

模块不包含在其中!

1 个答案:

答案 0 :(得分:0)

安装pyinstaller: 转到命令提示符,然后键入pip install pyinstaller

创建.exe: 如果要从.py创建.exe,则需要在文件的正确目录下打开命令提示符,然后键入:

pyinstaller —-onefile filename  // e.g hello.py as the filename

如果具有任何基本图形,请在命令提示符下键入以下内容

pyinstaller —-onefile -w then your file name

这应该一切正常。

如果没有,我建议您观看此video