简体   繁体   English

traceback.print_exc()python问题

[英]traceback.print_exc() python question

I am using the following line of code in IDLE to print out my traceback in an eception: 我在IDLE中使用以下代码行在回显中打印出我的追溯:

traceback.print_exc() traceback.print_exc()

For some reason I get the red text error message, but then it is followed by a blue text of "None". 由于某种原因,我收到红色文本错误消息,但随后是蓝色文本“ None”。

Not sure what that None is about, any ideas? 不知道“无”是什么意思,有什么想法吗?

print_exc() prints formatted exception to stderr. print_exc()格式化的异常打印到stderr。 If you need string value, call format_exc() 如果需要字符串值,请调用format_exc()

print_exc() doesn't return anything, which in Python is actually returning None . print_exc()不返回任何内容,在Python中实际上返回None Looks like IDLE is showing you the None it returned. 看起来IDLE正在向您显示返回的None

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

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