简体   繁体   English

访问 spyder 历史日志

[英]Accessing the spyder history log

In spyder I often look back for code I wrote in the past, via the command :在 spyder 中,我经常通过以下命令回顾我过去编写的代码:

%hist -g print if I want to see my print statements. %hist -g print如果我想查看我的打印语句。

But recently most of my history disappeared and I only have access to codes I wrote in the last days.但最近我的大部分历史都消失了,我只能访问我在最后几天写的代码。

I would like to manually access the history log, and have seen from multiple sources that it should be stored in a file 'history.py'.我想手动访问历史日志,并且从多个来源看到它应该存储在文件“history.py”中。 (eg How to see the console history of all commands in the IPython console in Spyder ). (例如, 如何在 Spyder 的 IPython 控制台中查看所有命令的控制台历史记录)。

I've gone through all the 'history.py' files I have and at most they define a class History but don't contain the actual codelines that I wrote in the past.我已经浏览了我拥有的所有“history.py”文件,它们至多定义了一个类 History 但不包含我过去编写的实际代码行。

So my question is : Which file contains the history itself and how do I access it ?所以我的问题是:哪个文件包含历史本身以及如何访问它?

( Spyder maintainer here ) Spyder's history is available at 这里Spyder 维护者)Spyder 的历史可在

~/.spyder-py3/history.py

where ~ stands for your Users directory on macOS and Windows.其中~代表您在 macOS 和 Windows 上的用户目录。

On a modern Linux distro this file is located at在现代 Linux 发行版中,此文件位于

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM