curses.window.inch
returns an int
, not a str
.
The following line:
if stdscr.inch(1, 1) == 'x':
should be:
if stdscr.inch(1, 1) & 0xff == ord('x'):
or using instr
(without specifying length, instr
returns a string that start at the given position to the end of the line):
if stdscr.instr(1, 1, 1) == 'x':