制作一个像 Vim/Mutt/Cmus 这样的完整终端窗口应用程序 [英] Make a full terminal window application like Vim/Mutt/Cmus

查看:23
本文介绍了制作一个像 Vim/Mutt/Cmus 这样的完整终端窗口应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不太确定如何表达这个,这可能就是我找不到答案的原因.

I'm not sure quite how to word this, which is probably why I'm having trouble finding an answer.

我有一个运行 rummy 游戏的命令行脚本,我希望它像 Vim 或 Mutt 一样接管终端,这样每一轮都会在完整的终端窗口中刷新,而不是仅仅打印出一行文本行.

I have a command line script that runs a rummy game, I want it to take over the terminal kind of like how Vim or Mutt does, so that each round is refreshed in the full terminal window rather than just printing out row after row of text.

谁能告诉我它叫什么,这样我就可以研究它并找出如何去做?

Can someone tell me what that is called, so I can research it and find out how to do it?

回购:https://github.com/sarcoma/Cards

推荐答案

正如评论中提到的pythons curses module do what you required".

As mentioned in a comment "pythons curses module does what you require".

这是接管终端所需要的:https://docs.python.org/3.9/howto/curses.html

This is what you need to take over the terminal: https://docs.python.org/3.9/howto/curses.html

这篇关于制作一个像 Vim/Mutt/Cmus 这样的完整终端窗口应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆