我正在嘗試使用Python(使用PyCharm 2.0)來運行簡單的curses腳本。Setupterm找不到終端,在使用curses的Python程序中
這是我的腳本:
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()
當我運行這個從我的IDE(PyCharm 2)我得到以下錯誤:
_curses.error: setupterm: could not find terminal
Process finished with exit code 1
如果我從bash中運行該腳本,它只會卡在while循環中,對p或q沒有反應。
任何幫助,將不勝感激。
爲我設置TERMINFO解決了我的問題。 – JohnMudd 2014-04-13 02:53:58