python常用

.py的文件默认是带命令行窗口的,.pyw的文件不带命令行窗口

让python程序停在某一行,这样就不会双击.py以后马上窗口弹出又没了

s = input('-->')

打印运行时异常,可以查看运行时错误,编译错误没办法显示


try:


except:
print(sys.exc_info()[0],sys.exc_info()[1])

import sys

原文地址:https://www.cnblogs.com/wangjixianyun/p/3416311.html