我是python初学者,最近我正尝试编写一个需要readchar模块的程序。但是,我一直收到错误消息:
termios.error: (25, 'Inappropriate ioctl for device')
我尝试调整代码,但始终收到相同的错误消息。这是我的代码:
import readchar
while True:
print(readchar.readkey())
(这是完整的错误消息。)
Traceback (most recent call last):
File "/Users/larajean/PycharmProjects/thegreatesthits/chordKeyboard.py", line 7, in <module>
chord = readchar.readkey()
File "/Users/larajean/PycharmProjects/thegreatesthits/venv/lib/python2.7/site-packages/readchar/readchar.py", line 20, in readkey
c1 = getchar()
File "/Users/larajean/PycharmProjects/thegreatesthits/venv/lib/python2.7/site-packages/readchar/readchar_linux.py", line 12, in readchar
old_settings = termios.tcgetattr(fd)
termios.error: (25, 'Inappropriate ioctl for device')
我正在使用PyCharm IDE和Python 2.7版本。有关如何解决此问题的任何建议?