Skip to main content
2 of 15
I just noticed I'm not the first here to try sitecustomize

Here's a method using​ sitecustomise.py (a user-defined module automatically imported by site). It's basically a more reliable and pythonic version of berdario's method

import sys
import readline
import atexit
oldhook = sys.__interactivehook__
def newhook():
    oldhook()
    atexit.unregister(readline.write_history_file)
sys.__interactivehook__ = newhook