Skip to content

Instantly share code, notes, and snippets.

@ricrogz
Last active July 25, 2016 15:37
Show Gist options
  • Save ricrogz/04431a7e2c371be220b2c760ffa31269 to your computer and use it in GitHub Desktop.
Save ricrogz/04431a7e2c371be220b2c760ffa31269 to your computer and use it in GitHub Desktop.
Python: history for input() method
import readline
"""
Just importing the 'readline' ('or 'gnureadline', as it has been renamed) package will do!
To add text completion: see here: https://pymotw.com/2/readline/
"""
While True:
line = input().strip()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment