Skip to content

Instantly share code, notes, and snippets.

@Svenito
Last active February 4, 2016 14:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Svenito/f2825d5a005faeec30d5 to your computer and use it in GitHub Desktop.
Save Svenito/f2825d5a005faeec30d5 to your computer and use it in GitHub Desktop.
Python startup file
# python startup file
import readline
import rlcompleter
import atexit
import os
# tab completion
readline.parse_and_bind('tab: complete')
# history file
histfile = os.path.join(os.environ['HOME'], '.pythonhistory')
try:
readline.read_history_file(histfile)
except IOError:
pass
atexit.register(readline.write_history_file, histfile)
del os, histfile, readline, rlcompleter, atexit
@barnabyrobson
Copy link

don't forge to del atexit too 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment