jupyter notebook 误删恢复

在jupyter notebook上使用IPython写了大段代码, 却不小心误删,

同时由于jupyter notebook只有一个存档位, 代码没有存档,或存档过久, 因此无法恢复原内容怎么办?

可以利用IPython强大的交互能力恢复出来!!

不要关jupyter notebook, 而是继续执行下面的代码

<code>for line in locals()['In']:
print(line)
#或者, 直接的
history/<code>

过往的输入历史就能很方便的显现出来, 然后手动恢复吧


jupyter notebook 误删恢复


分享到:


相關文章: