【发布时间】:2017-11-02 15:16:34
【问题描述】:
我有理由相信我的 iPython 解释器导致我的内核死机并重新启动,类似于在 this 链接和 that 链接中记录的问题。
后面的链接表明错误是由于调试器将ipdb的内容逐步输出到解释器中造成的。一位用户报告说,当他(和我引用)时,行为停止了
在调试模式下运行之前禁用日志记录到控制台
如何在 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 中的一个错误是正确的。为避免这种情况,您需要从代码中删除任何向控制台打印内容的指令。
-
我的指令都没有在控制台中打印任何内容。我指的是这种输出(请参阅对原始问题的编辑)。这是 ipdb 调试器的自动输出。