0
取数据我是很新,诅咒一个noob问题很抱歉:)我跑while True:
循环,从API获取数据,并使用功能show_header_and_footer()
呈现出来。然后它睡3秒钟以避免不断刷新并超过API提供程序限制。Python的诅咒:从API和残培()在同一时间
if __name__ == "__main__":
setup_curses()
while True:
catch_input()
show_header_and_footer()
stdscr.refresh()
header.refresh()
footer.refresh()
time.sleep(3)
正如你可能已经注意到,也有对catch_input()
函数的调用看起来像:
def catch_input():
c = stdscr.getch()
if c in (ord('q'), ord('Q')):
curses.raw()
curses.endwin()
一切正常,但点击“Q”后,我要等到time.sleep(3)
结束。我该如何改进?
它不工作,什么都没有改变 – mrpapa