Setupterm could not find terminal, in Python program using curses
问题 I am trying to get a simple curses script to run using Python (with PyCharm 2.0). This is my script: import curses stdscr = curses.initscr() curses.noecho() curses.cbreak() stdscr.keypad(1) while 1: c = stdscr.getch() if c == ord(\'p\'): print(\"I pressed p\") elif c == ord(\'q\'): break curses.nocbreak(); stdscr.keypad(0); curses.echo() curses.endwin() When I run this from my IDE (PyCharm 2) I get the following error: _curses.error: setupterm: could not find terminal Process finished with