I don't remember where I got it, but I have this in my home to provide history and tab-completion for python's default REPL:
$ cat ~/.pythonrc import os, atexit, readline, rlcompleter
hfile = os.path.join(os.environ['HOME'], '.python_history')
try: readline.read_history_file(hfile) except IOError: pass
readline.parse_and_bind('tab: complete') atexit.register(readline.write_history_file, hfile) del atexit, hfile
Agreed!
Authored Comments
I don't remember where I got it, but I have this in my home to provide history and tab-completion for python's default REPL:
$ cat ~/.pythonrc
import os, atexit, readline, rlcompleter
hfile = os.path.join(os.environ['HOME'], '.python_history')
try:
readline.read_history_file(hfile)
except IOError:
pass
readline.parse_and_bind('tab: complete')
atexit.register(readline.write_history_file, hfile)
del atexit, hfile
Agreed!