【发布时间】:2020-02-07 01:46:05
【问题描述】:
如果我关闭 Jupyter QtConsole 的一个实例并打开一个新实例,请点击 Up 键。然后加载我上次运行的上一个命令。
过去的命令历史保存在哪个目录?
我查看了 Github 上的源代码,但没有找到。它似乎也不在jupyter --paths 中的任何路径中。
【问题讨论】:
如果我关闭 Jupyter QtConsole 的一个实例并打开一个新实例,请点击 Up 键。然后加载我上次运行的上一个命令。
过去的命令历史保存在哪个目录?
我查看了 Github 上的源代码,但没有找到。它似乎也不在jupyter --paths 中的任何路径中。
【问题讨论】:
通过源代码调用堆栈是这样的:
HistoryConsoleWidget.history_previous()
HistoryConsoleWidget._get_edited_history()
HistoryConsoleWidget._set_history()
JupyterWidget._handle_history_reply()
找不到进一步的东西,所以认为这可能是 Jupyter 的事情。谷歌搜索这将我带到Where is the history file for ipython,实际上它存储在~/.ipython/profile_default/history.sqlite。
【讨论】: