如何在Windows上运行的PyQt应用程序中隐藏控制台窗口?

时间:2022-08-30 00:15:39

Surely this is possible? I have been hunting through PyQt tutorials and documentation but cannot find the answer to it. Probably I just need to phrase my search query differently.

当然这有可能吗?我一直在寻找PyQt教程和文档,但找不到答案。可能我只需要以不同方式表达我的搜索查询。

[Edit]

Thanks PEZ for the answer - more details including use of the .pyw extension in Python Programming on Win32 chapter 20

感谢PEZ的答案 - 更多细节,包括在Win32第20章的Python编程中使用.pyw扩展

2 个解决方案

#1


I think you should be able to run your app with pythonw.exe.

我认为你应该能够用pythonw.exe运行你的应用程序。

#2


An easy way to do this is to give your script a .pyw extension instead of the usual .py.

一种简单的方法是为脚本提供.pyw扩展名,而不是通常的.py。

This has the same effect as PEZ's answer (runs the script using pythonw.exe).

这与PEZ的答案(使用pythonw.exe运行脚本)具有相同的效果。

#1


I think you should be able to run your app with pythonw.exe.

我认为你应该能够用pythonw.exe运行你的应用程序。

#2


An easy way to do this is to give your script a .pyw extension instead of the usual .py.

一种简单的方法是为脚本提供.pyw扩展名,而不是通常的.py。

This has the same effect as PEZ's answer (runs the script using pythonw.exe).

这与PEZ的答案(使用pythonw.exe运行脚本)具有相同的效果。