()
| 15 | if not hasattr(__name__, "__file__"): # interpreter mode |
| 16 | |
| 17 | def autocomplete(): |
| 18 | import atexit |
| 19 | import os |
| 20 | import readline |
| 21 | import rlcompleter |
| 22 | |
| 23 | def save_history(): |
| 24 | readline.set_history_length(10000) |
| 25 | readline.write_history_file(history_path) |
| 26 | |
| 27 | history_path = os.path.expanduser("~/.pyhistory") |
| 28 | if os.path.exists(history_path): |
| 29 | readline.read_history_file(history_path) |
| 30 | atexit.register(save_history) |
| 31 | readline.parse_and_bind('tab: complete') |
| 32 | |
| 33 | autocomplete() |
| 34 |
no test coverage detected