Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
executable file 25 lines (17 sloc) 566 Bytes
try:
import readline
except ImportError:
print "Module readline not available."
else:
import atexit
import os
import rlcompleter
historyPath = os.path.expanduser("~/.python_history")
readline.parse_and_bind('tab: complete')
def save_history(historyPath=historyPath):
import readline
readline.write_history_file(historyPath)
if os.path.exists(historyPath):
readline.read_history_file(historyPath)
atexit.register(save_history)
del os, atexit, readline, rlcompleter, save_history, historyPath
Something went wrong with that request. Please try again.