访问 spyder 历史日志

Accessing the spyder history log

在 spyder 中,我经常通过以下命令回顾过去编写的代码:

%hist -g print 如果我想查看我的打印报表。

但最近我的大部分历史都消失了,我只能访问最近几天写的代码。

我想手动访问历史日志,并且从多个来源得知它应该存储在一个文件中 'history.py'。 (例如 How to see the console history of all commands in the IPython console in Spyder)。

我已经查看了我拥有的所有 'history.py' 文件,它们最多定义了一个 class 历史记录,但不包含我过去编写的实际代码行。

所以我的问题是:哪个文件本身包含历史记录,我如何访问它?

(这里是 Spyder 的维护者) Spyder 的历史可以在

~/.spyder-py3/history.py

其中 ~ 代表 macOS 上的用户目录,Windows。

在现代 Linux 发行版中,此文件位于

~/.config/spyder-py3/history.py