我有理由相信我的 iPython 解释器导致我的内核死机并重新启动,类似于 this 中记录的问题链接和 that链接。
后一个链接表明该错误是由于调试器将逐步 ipdb
内容输出到解释器中而引起的。一位用户报告说,当他(我引用)时,该行为停止了
disabled logging to console before running in debug mode
如何在 Spyder IDE/IPython 中“禁用控制台日志记录”?我真的需要这样做,这样我至少可以单步执行我的代码......
编辑
我想抑制这种输出
ipdb> > d:\temp\other const models\plaxis\output\plotparfile.py(16)PlotParFile()
14 with open(filename,'r') as fid:
15 lines = fid.readlines()
---> 16 fid.close()
17 #split first line get header and pop it out
18 header = lines[0].split()
> d:\temp\other const models\plaxis\output\plotparfile.py(18)PlotParFile()
16 fid.close()
17 #split first line get header and pop it out
---> 18 header = lines[0].split()
19 lines.pop(0)
20
最佳答案
(这里是 Spyder 开发人员)该输出是自动生成的,其目的是告诉您调试时代码的位置。
目前 Spyder 中没有选项可以停用它。此外,我真的怀疑输出可能是任何内核故障的原因。
关于debugging - 在 Spyder iPython 解释器中抑制 ipdb 输出,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44308115/