Skip to content

Instantly share code, notes, and snippets.

@nicolasmendoza
Created June 25, 2017 01:57
Show Gist options
  • Save nicolasmendoza/d60a6078cfc4f6b583048262b6f7c11e to your computer and use it in GitHub Desktop.
Save nicolasmendoza/d60a6078cfc4f6b583048262b6f7c11e to your computer and use it in GitHub Desktop.
export PYTHONSTARTUP=~/.pythonstartup
# 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment