简体   繁体   中英

Accessing the spyder history log

In spyder I often look back for code I wrote in the past, via the command :

%hist -g print if I want to see my print statements.

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'. (eg How to see the console history of all commands in the IPython console in Spyder ).

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.

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-py3/history.py

where ~ stands for your Users directory on macOS and Windows.

On a modern Linux distro this file is located at

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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