History#

With the History pane, you can view the recent code and commands you’ve entered into any IPython Console, along with their timestamp.

Spyder History Log, displaying a list of previously executed commands

Using the History pane#

Navigating the History pane is very straightforward. Each Spyder session is marked by a date and timestamp, making it easy to remember when you executed a certain command. Statements can be selected and copied from the context menu or with the normal system shortcuts. Just like in the Editor, selecting a word or phrase displays all other occurrences, and full syntax highlighting is also supported. The last ≈1000 lines entered are stored in the pane.

Options Menu#

The top-right options menu (Hamburger icon) allows you to toggle wrapping of long lines (Wrap lines), and whether the line number is displayed to the left of the text (Show line numbers).

Spyder History Log, displaying wrapping lines and showing line number

Advanced usage#

The list of commands shown in the History pane are stored in history.py in the .spyder-py3 directory in your user home folder (by default, C:/Users/username on Windows, /Users/username for macOS, and typically /home/username on GNU/Linux). You might need to show invisible files in order to see it on a non-Windows operating system.

Spyder History Log file

While there is currently no built-in way to clear history from the Spyder interface aside from resetting preferences, you can do so by closing Spyder, deleting this file and restarting Spyder again.