简体   繁体   English

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

[英]How can I hide the console window in a PyQt app running on Windows?

Surely this is possible? 当然这有可能吗? I have been hunting through PyQt tutorials and documentation but cannot find the answer to it. 我一直在寻找PyQt教程和文档,但无法找到它的答案。 Probably I just need to phrase my search query differently. 可能我只需要用不同的方式来表达我的搜索查询。

[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扩展

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

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运行脚本)具有相同的效果。

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

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