0

如果我关闭 Jupyter QtConsole 的一个实例,并打开一个新实例,请按一下Up键。然后加载我上次运行的上一个命令。

过去的命令历史保存在哪个目录中?

我查看了 Github 上的源代码,但没有找到。它似乎也没有出现在jupyter --paths.

4

1 回答 1

0

通过源代码调用堆栈就像:

HistoryConsoleWidget.history_previous()
HistoryConsoleWidget._get_edited_history()
HistoryConsoleWidget._set_history()
JupyterWidget._handle_history_reply()

找不到进一步的东西,所以认为这可能是 Jupyter 的事情。谷歌搜索这让我找到 ipython 的历史文件在哪里,实际上它存储在~/.ipython/profile_default/history.sqlite.

于 2020-02-07T02:45:22.597 回答