mat*_*ots 3 python curses callback
我有如下代码:
stdscr.nodelay(1)
while True:
c = stdscr.getch()
if c != -1:
stdscr.addstr("%s was pressed\n" % c)
if time() - last > 1:
stdscr.addstr("time() == %s\n" % str(time()))
last = time()
Run Code Online (Sandbox Code Playgroud)
但是,我担心我的代码真的很浪费/效率低下。是否有可用于诅咒的回调机制?如果没有,处理这种情况的规范方法是什么?
| 归档时间: |
|
| 查看次数: |
1308 次 |
| 最近记录: |