Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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'. (e.g 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 ?

like image 621
Mdégé Avatar asked Sep 14 '25 16:09

Mdégé


1 Answers

(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

like image 192
Carlos Cordoba Avatar answered Sep 16 '25 05:09

Carlos Cordoba