Archive

Posts Tagged ‘history’

Add History and Tab Completion to the Default Python Shell

Problem
You want history and TAB completion in your default Python shell. You are aware of bpython and ipython, but you miss this functionality in the default shell.

Solution
Edit ~/.bashrc:

# ~/.bashrc
export PYTHONSTARTUP=$HOME/.pythonstartup.py

Download pythonstartup.py from here and rename it to ~/.pythonstartup.py.

Advertisements