-
-
Notifications
You must be signed in to change notification settings - Fork 251
Open
Description
When running demo.py on macos, we get this error:
termios.error: (25, 'Inappropriate ioctl for device')
Hence I propose to use the following util function instead of
readchar.readkey()
def safe_readkey():
if not sys.stdin.isatty():
print("WARNING: stdin is not a TTY. Falling back to input().")
return input("Enter a key (then press Enter): ")[0]
try:
return readchar.readkey()
except Exception as e:
print(f"readkey() failed: {e}")
return input("Enter a key (then press Enter): ")[0]
bobgott
Metadata
Metadata
Assignees
Labels
No labels