Guy*_*uyC 3 python windows wxpython pyinstaller
我有一个相当简单的 GUI (wxPython) 应用程序并且运行良好。我使用的是 Windows 7。
使用pyinstaller
with -w
(or --noconsole
or --windowed
)编译它并运行它时,我可以看到一个控制台窗口一毫秒,然后它关闭。GUI 应用程序将无法运行。
不使用 -w 编译将生成一个带有控制台窗口的工作应用程序。
我在这里缺少什么?
有同样的问题。使用以下函数代替subprocess.Popen()
:
def popen(cmd):
startupinfo = subprocess.STARTUPINFO()
startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW
process = subprocess.Popen(cmd, startupinfo=startupinfo, stdout=subprocess.PIPE, stderr=subprocess.PIPE, stdin=subprocess.PIPE)
return process.stdout.read()
Run Code Online (Sandbox Code Playgroud)
返回类型与您得到的相同Popen().communicate()[0]
:) 与我的 GUI 应用程序配合得很好。使用 pyinstaller --noconsole 窗口化...
归档时间: |
|
查看次数: |
3796 次 |
最近记录: |