使用Python编辑文本并诅咒Textbox小部件? [英] Edit text using Python and curses Textbox widget?

查看:82
本文介绍了使用Python编辑文本并诅咒Textbox小部件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人有使用curses.textpad.Textbox小部件编辑现有文本的有效示例吗?当然,这是在Linux终端(例如xterm)中.

Has anybody got a working example of using the curses.textpad.Textbox widget to edit existing text? This is, of course, in a Linux terminal (e.g. xterm).

推荐答案

我发现 urwid中的Edit小部件软件包足以满足我的需求.这不是Textpad小部件,但有所不同.无论如何,urwid软件包总体上更好.但是,它仍然不是没有痛苦的. Edit小部件确实允许插入文本,但不允许覆盖(使用Ins键切换),但这没什么大不了的.

I found that the Edit widget in the urwid package is sufficient for my needs. This is not the Textpad widget, but something different. The urwid package is overall nicer, anyway. However, it's still not pain-free. The Edit widget does allow inserting text, but not overwriting (toggled with Ins key), but that's not a big deal.

这篇关于使用Python编辑文本并诅咒Textbox小部件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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