[英]Python converted to .exe (via Pyinstaller) doesn't work
I convert a simple print("Hello World")
code form Python to .exe with Pyinstaller (with the comand pyinstaller -wF
) and apparently it creates the file properly. 我使用Pyinstaller(使用
pyinstaller -wF
)将简单的print("Hello World")
代码从Python转换为.exe,显然可以正确创建文件。 However, when I execute it, nothing happens. 但是,当我执行它时,什么也没有发生。
Nothing happens because print()
sends a message to standard output (your terminal), but an .exe has no terminal. 什么都没有发生,因为
print()
将消息发送到标准输出(您的终端),但是.exe没有终端。 You can try to implement a GUI to display this information (in a module like tkinter
), or have your program do something else like open a program or file on your computer! 您可以尝试实现GUI来显示此信息(在
tkinter
类的模块中),或者让您的程序执行其他操作,例如在计算机上打开程序或文件!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.