How can I disable the new history feature in Python 3.4?
Another ~/.pythonrc solution:
import readline
readline.write_history_file = lambda *args: None
As of Python 3.6, you can use readline.set_auto_history to disable this:
import readline
readline.set_auto_history(False)
This works for me.
Creating ~/.pythonrc
file:
import os
import atexit
import readline
readline_history_file = os.path.join(os.path.expanduser('~'), '.python_history')
try:
readline.read_history_file(readline_history_file)
except IOError:
pass
readline.set_history_length(0)
atexit.register(readline.write_history_file, readline_history_file)
Then export it:
export PYTHONSTARTUP=~/.pythonrc