我收到有关curses.initscr
的错误。我该怎么办?
import curses
screen = curses.initscr()
curses.noecho
curses.cbreak
screen.keyboard(True)
try:
while True:
char = screen.getch()
if char == ord("a"):
print('Forward')
finally:
curses.nobreak()
screen.keypad(0)
curses.echo()
curses.endwin()
错误:
Traceback (most recent call last):
File "C:\Python\Python3\PythonWork\Test1.py", line 24, in <module>
screen = curses.initscr()
File "C:\Python\Python37\lib\curses\__init__.py", line 30, in initscr fd=_sys.__stdout__.fileno())
AttributeError: 'NoneType' object has no attribute 'fileno'
这是什么意思?
我在Windows上工作,但设法在其上安装了curses
模块。