Is there a way to create a separate display and input on the same terminal using curse?

前端 未结 3 732
闹比i
闹比i 2021-01-12 16:11

I\'d like to code a command line program that result in this UI:

------------
|          |
|     A    |
|__________|
|_____B____|

A is a se

相关标签:
3条回答
  • 2021-01-12 16:41

    Enventually I tried to do it with urwid which is way higher level than ncurse.

    I asked a question about it on SO and didn't got more results.

    But eventually I found some FOSS that did just that, I used the source code and made something that worked. You can find the answer in the related question.

    0 讨论(0)
  • 2021-01-12 16:44

    Have a look at the /Demo/curses/ directory of the python source code. It lists several intersting examples using the curses module that you can learn all you need from, and some more.

    0 讨论(0)
  • 2021-01-12 16:46

    For posterity - this is a great implementation of the architecture you desire, written with urwid (an ncurses wrapper): http://zderadicka.eu/terminal-interfaces-in-python/#comment-123799

    It took some tweaking to turn it into a chat client, but it's pretty simple to do so with pipes. The author's code is on github: https://github.com/izderadicka/xmpp-tester/blob/master/commander.py

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