问题描述
我是 Python 编程的新手.任何人都可以解释什么是 *.pyw 文件以及它是如何工作的.
I am new to Python programming. Can anybody provide an explanation on what a *.pyw file is and how it works.
推荐答案
您还可以使用 pythonw.exe 执行所有 .py 脚本,设置这通过通常的设施,例如(可能需要管理权限):
You can also make all .py scripts execute with pythonw.exe, setting this through the usual facilities, for example (might require administrative rights):
https://docs.python.org/2/using/windows.html
所以在实践中唯一的区别是一个控制台窗口挂在周围,另一个没有.*.pyw 最明显的用法是 GUI 应用程序,因为具有独立 GUI 的应用程序显然不需要或不需要控制台窗口.
So in practice the only difference is that one leaves a console window hanging around and the other doesn't. The most obvious usage for *.pyw are GUI apps since an app with an independent GUI obviously does not need or want the console window around.
python.exe 和 pythonw.exe 之间存在一些细微的实现差异,请参见 https://stackoverflow.com/a/30313091/3703989
There are some subtle implementation differences between python.exe and pythonw.exe see https://stackoverflow.com/a/30313091/3703989
这篇关于python程序中的.pyw文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!