Created
January 30, 2023 03:14
-
-
Save DetachHead/364c62a97c264bd8cafc7c49efe1afe3 to your computer and use it in GitHub Desktop.
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
# a python repl that actually exits on ctrl+C | |
while True: | |
try: | |
code = input(">>> ") | |
try: | |
print(eval(code)) | |
except SyntaxError: | |
exec(code) | |
except KeyboardInterrupt: | |
exit(1) | |
except BaseException as e: | |
print(e) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment