问题标签 [urwid]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
818 浏览

python - urwid 即时更改调色板颜色

在urwid中,我如何动态更改调色板的颜色?例如,假设我想在按下“C”按钮时进行更改:

0 投票
4 回答
1746 浏览

python - Urwid:使光标不可见

我正在使用 urwid,它是一个 Python“框架”,用于在 ncurses 中设计终端用户界面。虽然我无法在 urwid 中做一件事,但在诅咒中很容易 - 使光标不可见。就像现在一样,在选择按钮时光标是可见的,而且看起来很丑。有没有办法禁用它?

0 投票
1 回答
1019 浏览

python - 如何获取 urwid RadioButton 和 CheckBox 值?

urwid 示例之一中,我试图获取并打印用户选择的 RadioButton 和 CheckBox 值。

到目前为止,我有下面的代码(python27)并且无法确定哪个对象返回用户的选择。

0 投票
1 回答
1402 浏览

python - 如何更新 urwid 中显示的文本?

和urwid混淆了。通过调整 urwid 示例之一,我获得了初始屏幕,并希望在按下 F5 键时执行 run_stuff() 函数,并显示指示 run_stuff() 正在运行并最终完成的消息(理想情况下带有进度条,但只显示消息将做)。

到目前为止,我的代码如下,告诉我运行第二个主循环不是一个好主意,但无法找到用新文本更新屏幕的其他方法。

0 投票
1 回答
1183 浏览

python - Python URWID 调色板

我需要帮助了解着色如何为 urwid 工作

来自文档: http ://urwid.org/manual/displayattributes.html#id6

我想使用的颜色:


用法:http ://urwid.org/tutorial/index.html#high-color-modes

0 投票
1 回答
725 浏览

python-3.x - 如何在urwid中指定边框?

我是 urwid 的新手,我认为我误解了一些东西。我不明白为什么这不起作用。而且我不明白错误消息。

0 投票
1 回答
679 浏览

python - Urwid 水平菜单 - 返回之前的状态或重新启动循环

我正在基于Urwid 的 Horizo​​ntal Menu示例构建一个应用程序。我有一个项目,我想显示一些信息。我在下面有一个“确定”按钮,我希望它可以将菜单弹出回之前的状态,或者重新启动整个屏幕/循环。

在示例中,他们使用ExitMainLoop(),但我不想退出 - 我只想重新启动它。因此,我已将回调更改为不同的函数 - 但我所有的尝试要么什么都不做,要么让我的程序崩溃。

以下是相关位:

启动菜单:

相关菜单类/功能。我的问题是 -does_nothing函数中有什么?

0 投票
1 回答
292 浏览

python - 多个 urwid 调用获取终端大小使文件保持打开状态

如果我拨打以下电话:

...文件描述符保持打开状态。多次调用此函数会使 Python 3 解释器崩溃;特别是如果像我以前那样做:

如何防止出现以下错误?

OSError: [Errno 24] Too many open files

0 投票
1 回答
559 浏览

python-3.x - 使用urwid,如何通过按键一次显示一行?

尝试创建一个简单的函数,在按下回车键或向下翻页键时,一次显示文本文件中的一行。我希望每次都清除线条。换句话说,我需要暂停程序直到下一次按键。因为它只显示第一行。我尝试了一段时间 True: 无济于事。谢谢你的帮助!

0 投票
1 回答
369 浏览

python - Passing stdout from interactive python application to cd command (subshell?)

If I am taking over stdout, with an interactive Python script that launches a console GUI such as curses or urwid; after some actions and closing the loop, how could I cd to a path printed in stdout?

For example,

When run, and pressing q or Q to quit the urwid loop:

If this was a simple python script that only printed to stdout, I could cd $(python simple_script.py). With the above, however, this will hang as the python subshell fails to hijack stdout and process input.

Is it possible to work around this without writing to file?