python文件以什么结尾
python文件后缀一般有两个,分别是.py和.pyw
视窗用python.exe运行.py,用pythonw.exe运行.pyw。
这纯粹是因为安装视窗版Python时,扩展名.py自动被登记为用python.exe运行的文件,而.pyw则被登记为用pythonw.exe运行。
.py和.pyw之间的“其它差别”全都是python.exe和pythonw.exe之间的差别。跟python.exe比较起来,pythonw.exe有以下的不同:
1)执行时不会弹出控制台窗口(也叫DOS窗口)
2)所有向原有的stdout和stderr的输出都无效
3)所有从原有的stdin的读取都只会得到EOF
.pyw格式是被设计来运行开发完成的纯图形界面程序的。
纯图形界面程序的用户不需要看到控制台窗口。
值得一提的是,开发纯图形界面程序的时候,你可以暂时把.pyw改成.py,以便运行时能调出控制台窗口,看到所有错误信息
以上内容为大家介绍了python文件以什么结尾,希望对大家有所帮助,如果想要了解更多Python相关知识,请关注IT培训机构:千锋教育。

相关推荐HOT
更多>>
python正则表达式中的零宽断言
python正则表达式中的零宽断言1、概念有些元字符不匹配任何字符,只是简单的表示成功或失败,所以这些字符也叫零宽断言。2、符号举例(1)|或操作...详情>>
2023-11-14 11:35:03
python方法的绑定和未绑定
python方法的绑定和未绑定1、说明未绑定对象的方法:无self参数的方法,通过定义类调用函数,返回未绑定self的方法。绑定对象的方法:带self参...详情>>
2023-11-14 09:53:02
python海象运算符的使用
python海象运算符的使用1、在判断条件下允许操作。在一定程度上简化了代码,但降低了可读性。i=len((l:=[1,2,3]))#先对l进行赋值,在对i赋值whi...详情>>
2023-11-14 02:38:21
pythonelif语句报错是什么原因
python的else和elif语句也可以叫做子句,因为它们不能独立使用,两者都是出现在if、for、while语句内部的。else子句可以增加一种选择;而elif子...详情>>
2023-11-13 21:46:35热门推荐
技术干货






