You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Reads the next char from stdin, returning it as a string with length 1.
However, it appears to return a byte sequence:
example.py:
import readchar
print("Press a key")
pressed = readchar.readchar()
print(type(pressed))
Output:
$ python example.py
Press a key
<class 'bytes'>
This is using
$ pip show readchar
Name: readchar
Version: 2.0.1
Summary: Utilities to read single characters and key-strokes
Home-page: https://github.com/magmax/python-readchar
Author: Miguel Ángel García
Author-email: [email protected]
License: MIT
on Windows in a Git Bash prompt.
The text was updated successfully, but these errors were encountered:
The documentation for
readchar
states:However, it appears to return a byte sequence:
example.py:
Output:
This is using
on Windows in a Git Bash prompt.
The text was updated successfully, but these errors were encountered: