【发布时间】:2021-02-11 11:00:15
【问题描述】:
在 jupyter 中有一个神奇的函数可以捕获和解析单元格的输出:
%%capture capt_out
# cell body that prints interesting stuff every second
# another cell
# code for printing or processing output (i.e for plots):
print(capt_out)
问题是,我需要实时查看输出(因为这是一个暗网模型训练,我需要知道已经取得了多少进展),然后对其进行解析以创建基于它的绘图。
有没有一种简单的方法可以在不抑制打印的情况下捕获输出?
【问题讨论】:
-
问题实际上与
machine-learning无关 - 请不要向无关标签发送垃圾邮件(已删除)。 -
好吧抱歉,不是故意的
标签: python jupyter-notebook output capture