问题描述
我如何编译一个GUI应用程序与Pyinstaller,并且只有获取GUI wxPython生成,当我运行可执行文件?此时,当我运行exe,一个cmd窗口弹出,然后wxPython窗口。这是很好的,当我调试,但是当我分发我的应用程序时,不会有任何使用(可能甚至是对手!)
How can I "compile" a GUI application with Pyinstaller, and only get the GUI wxPython generates, when I run the executable? At the moment, when I run the exe, a cmd window pops up, and then the wxPython Window. This is nice when I'm debugging, but isn't gonna be any use (probably even the oposite!) when I distribute my app.
推荐答案
我想你需要将EXE类中的控制台参数设置为False。请参见附近的一个spec文件,为我工作。看起来你可以通过传递-w在创建规范文件时自动包括该设置。这也在教程中提到。
I think you need to set the console argument in the EXE class to False. See http://www.blog.pythonlibrary.org/2010/08/10/a-pyinstaller-tutorial-build-a-binary-series/ near the end for a spec file that worked for me. It looks like you can get the spec file to include that setting automatically by passing "-w" when you create it. That's also mentioned in the tutorial.
这篇关于使用Pyinstaller编译应用程序,但运行生成的exe时不要启动cmd的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!