如何开发一个基于 Curses 的 UI?

发布于 2024-09-16 17:02:03 字数 474 浏览 7 评论 0原文

我计划开发一个使用curses 的GUI 应用程序。这个想法是为 Web 界面提供一个额外的界面,以便网站上的所有内容也可以通过 UI 完成。

基本上,它应该是独立于平台的:用户必须通过 SSH 连接到服务器,之后 UI 将自动接管。

首先,这可行吗?据我了解,只要最终用户安装了正确的终端软件,它就与平台无关。如果我错了,请纠正我。

我打算使用 Python 来实现此目的,因为它是我最精通的语言。Python 附带 ncurses 库和 Urwid,据我所知,相当不错。

在对 Urwid 进行快速测试后,我遇到了一些问题。问题是,我很担心我找不到未来遇到的问题的答案,因为显然诅咒 UI-s 现在并不流行。因此,文档和示例非常稀缺。

总而言之,我真的应该开始做这件事并停止抱怨,还是完全放弃这个想法?还有其他建议吗?

I'm planning to develop a GUI application that uses curses. The idea is to provide an extra interface for a web interface, so that everything on the web site could also be done via the UI.

Basically, it should be platform independent: the user would have to SSH to the server after which the UI would automatically take over.

First of all, is this doable? As far as I understand, it would be platform independent as long as the end-user had the proper terminal software installed. Correct me, if I'm wrong.

I was planning to use Python for this, as it is the language I'm the most proficient in. Python comes with the ncurses library and Urwid, which I've been told, is quite good.

After having a quick test with Urwid, I had some problems. The thing is, I'm quite worried that I won't find answers to the problems that I will encounter down the road because apparently curses UI-s aren't all the rage nowadays. Documentation and examples are thus quite scarce.

In conclusion, should really I embark on this and quit my whining or drop the idea altogether? Any other suggestions?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

浅笑依然 2024-09-23 17:02:03

这当然是可能的,并且基于curses的应用程序仍然定期编写(例如PuDB只有14个月的历史),尽管可能不是很频繁。

您是否尝试过在 Urwid 邮件列表和/或 IRC 频道上提问?

It's certainly possible, and curses-based applications are still written regularly (e.g. PuDB is only 14 months old) although maybe not very often.

Did you try asking questions on the Urwid mailing list and/or IRC channel?

油饼 2024-09-23 17:02:03

天哪,这不是梦吗!

我已经看到一些事情取得了不同程度的成功。

Morticious Thrind:http://thrind.xamai.ca/

未来死亡人数:http://f-dt.com/?wptheme=wp-cli

wordpress yadda yadda,这可能是就像 960/blueprint CSS、prototype.js 和 oneliner 一样简单:

//TODO: Implement useful functionality && unit tests && documentation
//TODO: read 

try { eval($F(x)); } catch (e) { panic(); }

但是!这种事情是相当激进的。我的意思是——现在网络浏览器的画布上任何事情都可能发生,但是任何终端模拟器或 lynx 都可以通过 Flare 来实现此目的。

还请务必查看:https://stackoverflow.com/questions/472644 /javascript-collection-of-one-line-useful-functions

真正的问题是你计划使用什么类型的 ncursing 软件(原文如此,双关语等)——它可能已经有一些相当有用的命令行接口(sh)。

oh my, wouldn't this be a dream!

i've seen a couple of things out there to varying degrees of success.

Morticious Thrind: http://thrind.xamai.ca/

future death toll: http://f-dt.com/?wptheme=wp-cli

wordpress yadda yadda, this could be as simple as a 960/blueprint CSS, prototype.js, and a oneliner:

//TODO: Implement useful functionality && unit tests && documentation
//TODO: read 

try { eval($F(x)); } catch (e) { panic(); }

BUT! this type of thing is pretty radical. i mean- ANYTHING can happen on the canvas of a web-browser these days, but any terminal emulator or lynx serves this purpose with flare.

also be sure to check out: https://stackoverflow.com/questions/472644/javascript-collection-of-one-line-useful-functions

the real question is what sort of software you plan on ncursing (sic,pun,etc.)-- it probably already has some rather useful command-line interfaces (sh).

蝶…霜飞 2024-09-23 17:02:03

这是可以做到的,但这是一场斗争。我建议改进网络界面。例如,您可以使用 JavaScript 添加键盘快捷键,这对于加快工作流程非常有帮助(例如,请参阅 Gmail 的界面)。

It can be done but it's a struggle. I would recommend improving the web interface. You can use JavaScript to add keyboard shortcuts, for example, which can be very helpful for a faster workflow (see Gmail's interface, for example).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文