简体   繁体   English

从 .py 创建 exe 文件

[英]Create exe files from .py

I have a program with python and it has 3 modules .py.我有一个 python 程序,它有 3 个模块 .py。

what should i do to create exe format of this program?我应该怎么做才能创建这个程序的 exe 格式?

i try this with pyinstaller but thats create exe for my main .py and other .py我用 pyinstaller 试试这个,但那是为我的主 .py 和其他 .py 创建 exe

modules not contains in it!模块不包含在其中!

Install pyinstaller: Go to command prompt and type pip install pyinstaller .安装 pyinstaller:转到命令提示符并键入pip install pyinstaller

Create .exe: If you want to create a .exe from a .py you need to open your command prompt under the correct directory of the file and type:创建 .exe:如果要从 .py 创建 .exe,则需要在文件的正确目录下打开命令提示符并键入:

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

If it has any basic graphics, type the following in command prompt如果它有任何基本图形,请在命令提示符下键入以下内容

pyinstaller —-onefile -w then your file name

This should all work.这应该都有效。

If it does not I recommend that you watch this video .如果没有,我建议您观看此视频

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM