curses in python getstr() while refreshing

后端 未结 1 1829
予麋鹿
予麋鹿 2021-01-13 11:51

I am writing a front end for a server application using the curses module. THe main windows returned by curses is divided into 2 sub-windows. The top half of the screen pr

相关标签:
1条回答
  • 2021-01-13 12:46

    I'm guessing you are using a thread to update the upper display while window.getstr() runs in the main thread?

    If so, the problem is that the curses terminal state is a shared resource that can't be updated from two different threads simultaneously. You need to put the terminal into non-blocking mode, use window.getch() to build up an input string and have your thread pass the upper window update task to the main thread.

    0 讨论(0)
提交回复
热议问题