<filename>modules/shared/programs/python/files/python/startup.py<gh_stars>1-10
import os


def register_readline():
    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)


register_readline()

<filename>modules/shared/programs/python/files/python/startup.py<gh_stars>1-10
import os


def register_readline():
    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)


register_readline()
