3
我正在尝试调试python代码,我想引脚指向发生错误的行号。根据发现的帖子asked here该代码给出了被调用的函数的行号。例如获取错误行号Python
if __name__ == '__main__':
try:
foo()
except:
<the code to print line no when error occurs>
但它给了我行没有的foo(), 请帮忙没有找到确切的行中发生错误。
感谢,
非常感谢,它的工作。 – someone