我试图让一个简单的curses脚本使用Python运行(使用PyCharm 2.0).
这是我的脚本:
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()
Run Code Online (Sandbox Code Playgroud)
当我从我的IDE(PyCharm 2)运行它时,我收到以下错误:
_curses.error: setupterm: could not find terminal
Process finished with exit code 1
如果我从bash运行脚本,它将只是停留在while循环中,而不是按p或q作出反应.
任何帮助,将不胜感激.
我正在使用Closure Box进行一些Clojure教程,并输入以下代码:
user> (def stooges (vector "Moe" "Larry" "Curly"))
#'user/stooges
user> (contains? stooges "Moe")
false
Run Code Online (Sandbox Code Playgroud)
这不应该评估为真?任何帮助表示赞赏.