stupidcomputer
82636ae45f
some changes: - move pythonrc to be copied to ~/.config/python/pythonrc*.py*, instead of ~/.config/python/pythonrc.py - remove spurious print statement from pythonrc.py
18 lines
325 B
Python
18 lines
325 B
Python
import os
|
|
import atexit
|
|
import readline
|
|
|
|
history = os.path.join(os.path.expanduser('~'), '.cache/python_history')
|
|
try:
|
|
readline.read_history_file(history)
|
|
except OSError:
|
|
pass
|
|
|
|
def write_history():
|
|
try:
|
|
readline.write_history_file(history)
|
|
except OSError:
|
|
pass
|
|
|
|
atexit.register(write_history)
|