Please show a complete error message by copying and pasting, starting from the line that says Traceback (most recent call last): until the end, and formatting it the same way as the code. (Feel free to redact file/path names if they are sensitive.)
Error initializing standard platform: Cannot use unix platform on non-file-like stream
When I call function, I see this :
fct()
Traceback (most recent call last):
File "<pyshell#10>", line 1, in <module>
fct()
File "/Users/lolo/Documents/Laurent/Python codes/test1.py", line 20, in fct
key = getkey()
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/getkey/platforms.py", line 39, in getkey
for c in self.getchars(blocking):
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/getkey/platforms.py", line 66, in getchars
char = self.getchar(blocking)
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/getkey/platforms.py", line 218, in getchar
raise RuntimeError('Cannot getkey on invalid platform!')
RuntimeError: Cannot getkey on invalid platform!
The latest version I’m seeing of the getkey package on PyPI is 0.6.4 from 2016, nearly 8 years ago, and only declares support up to Python 3.5. It may simply not support modern Python. Alternatively, if you are using some fork (I couldn’t easily find one on PyPI with that version), there may be a bug in it not supporting your specific OS/version.
Thanks for informations about versions.
The main purpose in fact is to find a function that can send me the character that I type on keyboard. str(input()) can do it but I need to type ‘enter’ and I don’t want.
Do you know another function equivalent to getkey ?