jupyter notebook 誤刪恢復

在jupyter notebook上使用IPython寫了大段代碼, 卻不小心誤刪,

同時由於jupyter notebook只有一個存檔位, 代碼沒有存檔,或存檔過久, 因此無法恢復原內容怎麼辦?

可以利用IPython強大的交互能力恢復出來!!

不要關jupyter notebook, 而是繼續執行下面的代碼

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

過往的輸入歷史就能很方便的顯現出來, 然後手動恢復吧


jupyter notebook 誤刪恢復


分享到:


相關文章: