Search This Blog

Sunday, August 5, 2012

How to configure the Python interpreter to save all your commands to a history file on a disk

The interactive Python interpreter is a great way to quickly test python expressions and code snippets. With the default configuration the only disadvantage is that it doesn't keep any history of the commands your run last time. If you restart the interpreter you have to type all commands again and again.

Solution

On of the solution is to define a script to execute when the interpreter starts. This is described here [1]. My own configs can be found here [2].
  1. http://docs.python.org/tutorial/interactive.html
  2. https://github.com/rtomaszewski/configs

No comments:

Post a Comment