Created
January 24, 2012 15:41
-
-
Save danse/1670750 to your computer and use it in GitHub Desktop.
Add autocompletion to python shell
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
To add autocompletion to the python shell, add the following export into your .bashrc file: | |
export PYTHONSTARTUP=/home/<user>/.pythonstartup | |
Where <user> is your username, and .pythonstartup is a file containing the following two lines: | |
import rlcompleter, readline | |
readline.parse_and_bind('tab: complete') | |
To test if the change worked, start a python shell and type | |
>>> import sys | |
>>> sys. | |
Then type Tab. A completion list should appear. | |
Reference: http://docs.python.org/release/2.6.6/tutorial/interactive.html#key-bindings |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment