代码是:
from curses import *
from curses.panel import *
def main(stdscr):
start_color()
curs_set(0)
init_pair(1, COLOR_BLACK, COLOR_CYAN)
posy = posx = 0
window = newwin(1, 1, posy, posx)
panel = new_panel(window)
window.addstr('*', color_pair(1))
update_panels()
doupdate()
while True:
key = stdscr.getch()
if key == ord('j'):
posy+=1
elif key == ord('k'):
posy-=1
elif key == ord('h'):
posx-=1
elif key == ord('l'):
posx+=1
elif key == ord('q'):
endwin()
break
panel.move(posy,posx)
update_panels()
doupdate()
if __name__ == '__main__':
wrapper(main)
Run Code Online (Sandbox Code Playgroud)
我收到此错误:
Traceback (most recent call last):
File …Run Code Online (Sandbox Code Playgroud)