Created
March 15, 2021 20:06
-
-
Save ILightThings/fcd7d045ce30698ffd182139e027ebe1 to your computer and use it in GitHub Desktop.
Useful for sending variants of the same data over again but needing to edit it slightly.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import readline | |
| def rlinput(prefill): | |
| readline.set_startup_hook(lambda: readline.insert_text(prefill)) | |
| try: | |
| return input() # or raw_input in Python 2 | |
| finally: | |
| readline.set_startup_hook() | |
| query = "" | |
| while True: | |
| query = rlinput(query) | |
| print(f"The new line is: {query}") | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment