We don’t allow questions seeking recommendations for software libraries, tutorials, tools, books, or other off-site resources. You can edit the question so it can be answered with facts and citations.
Closed 3 years ago.
The community reviewed whether to reopen this question 2 years ago and left it closed:
Original close reason(s) were not resolved
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(4)
“我正在尝试编写一个显示文件夹树的组件”
CDK 有
CDKFSELECT
小部件。它显示可能适合您的目录和文件列表,或者
CDKFSELECT 的源代码可用于您自己的自定义编写
解决方案。
"I'm trying to write a component that shows a tree of folders"
CDK has the
CDKFSELECT
widget.It displays a list of directories and files, that might work for you, or the
source code of CDKFSELECT might be leveraged for your own custom written
solution.
dialog
程序(具有文档化的库接口)有一个 "tree" 小部件。该程序与 (n)curses 一起使用,与 CDK 不同,它适合与UTF-8。它还有一个 file(/directory ) 选择小部件。
还有
wcd
(尽管就像mc
一样,的可重用性库不确定)。然而,这是OP可能想要的一个很好的例子:关于
urwid
,这是有争议的。在幕后你可能实际上并没有诅咒。就其价值而言,treeview 脚本的屏幕截图:并且在我的 Debian/测试系统上,该脚本不使用 ncurses。它是硬编码的(即使用
raw_display
)。The
dialog
program (which has a documented library interface) has a "tree" widget. The program works with (n)curses, and unlike CDK, is suitable for use with UTF-8.It also has a file(/directory) selection widget.
There's also
wcd
(though likemc
, reusability of the library is uncertain). However, it is a good example of what OP probably wants:Regarding
urwid
, that's debatable. Under the hood you may not actually have curses. For what it's worth, a screenshot of the treeview script:and on my Debian/testing system, the script doesn't use ncurses. It's hardcoded (i.e., using
raw_display
).Urwid 有一个树形小部件,FWIW。
更新:2020-10-01 - 我在 2010 年写了我的答案,当时我为 Urwid 编写了一个树小部件,因为我找不到任何东西。 Urwid 仍然有树小部件,但这些天,我会看看 Python 的提示工具包 或 替代方案之一。
Urwid has a tree widget, FWIW.
UPDATE: 2020-10-01 - I wrote my answer back in 2010, when I wrote a tree widget for Urwid since I couldn't find anything. Urwid still has the tree widget, but these days, I would look at Python's prompt-toolkit or one of the alternatives.
查看午夜指挥官源代码 (http://www.midnight-commander.org/)它有一个树存储小部件。
Look at the Midnight commander source code (http://www.midnight-commander.org/) It has a tree store widget.