简体   繁体   English

如何从 .py 文件创建 .exe 文件

[英]How to create a .exe file from a .py file

I had built a simple program with minimalistic code Code and converted it into a.exe file using command prompt after which it refused to boot after I opened the.exe file in Visual Studio after which it prompted this我用简约的代码代码构建了一个简单的程序,并使用命令提示符将其转换为 .exe 文件,之后我在 Visual Studio 中打开 .exe 文件后它拒绝启动,之后它提示这个

在此处输入图像描述

and allowed it to fix some errors then I saw some changes in the program, But then when I tried to open it, This showed up并允许它修复一些错误然后我看到程序中的一些变化,但是当我试图打开它时,这出现了

在此处输入图像描述

and so is there a way to make the program boot and run and do I need additional code to make the program run?那么有没有办法让程序启动和运行,我需要额外的代码来让程序运行吗?

Easy-peasy solution.简单易行的解决方案。 Do pip install pyinstaller and then from run pyinstaller --onefile filename.pypip install pyinstaller然后从运行pyinstaller --onefile filename.py

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

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