当您了解脚本和 HCI 时,该学习哪种 GUI 框架

发布于 2024-08-24 06:14:14 字数 854 浏览 9 评论 0原文

我有一些关于人机交互的知识和一些基本知识编程脚本(Python),它们从头到尾运行并自动执行一些我想做的任务或计算。过去,我使用 HTML 构建界面,并在其背后使用 PHP。

我希望我的 python 脚本从命令行发展而来,并构建一些带有 GUI 的应用程序,允许用户拖动文件和按钮来启动操作并以图形方式检查进度。

由于我用 Python 编写脚本,所以我查看了一些选项(Tkinter、wxPython、PyQt),但我无法在它们之间做出决定,花时间学习其中一个而不是另一个。我的标准:

  • 为 GUI 程序员提供介绍(与脚本有什么区别,一些简单接口的示例)
  • 一个框架,允许我在我最常使用的平台(Windows)上运行我的程序,但也可以在Mac 或许还有 Linux,无需太多修改。
  • 学习曲线非常浅(易于制作第一个界面),但后来可以灵活地自定义界面,超出典型操作系统允许的范围(例如按钮的不同颜色、大小和形状)
  • 如果不一样,则类似于您对 GUI 进行编程的方式Android 和/或诺基亚智能手机。我计划在不久的将来为这些平台编写一些程序,因此如果可能的话,我想将这里的一些课程带到这些平台上。

我确实找到了这个上一个问题,但没有一个答案是令人满意。

是否有任何框架比其他框架更适合这些要求,或者它们本质上相似并且我会对它们中的任何一个感到满意?

注意:如果您认为我应该考虑使用其他语言而不是 Python 来实现此目的,那么是哪一种?我真的很喜欢 Python 空格语法并且已经习惯了它,所以我宁愿坚持使用它。

I have some knowledge about Human computer interaction and some basic knowledge programming scripts (Python) that run from start to finish and automate some tasks I want to do or calculations. In the past I built interfaces in HTML with PHP behind it.

I would like my python scripts to evolve from the command line and build some applications with GUIs that would allow the user to drag files and push buttons to initiate operations and check progress graphically.

Since I write my scripts in Python I looked at some of the options (Tkinter, wxPython, PyQt) but I can't make a decision between them to invest my time learn one and not the other. My criteria:

  • Has a introduction for programmers for GUI (what are the differences from a script, examples of some simple interfaces)
  • A framework that would allow me to run my programs on the platforms I use most (Windows) but that can also run on Mac and maybe Linux, without too much modification.
  • Very shallow learning curve (easy to make first interfaces) but flexibility later on to customize the interface beyond what the typical OS allows (different colors, size and shapes of buttons, for example)
  • If not the same, similar to how you program GUI for Android and/or Nokia smartphones. I'm planning to write some programs for these platforms in the near future so I would like to carry over some of the lessons here onto those platforms, if possible.

I did find this previous question but none of the answers are satisfactory.

Does any of the frameworks fit these requirements better than the others or are they essentially similar and I would be happy with any of them?

Note: If you think I should consider other language rather than Python to achieve this, which one? I really like Python whitespace syntax and have grown used to it so I would prefer to stick with it.

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

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

发布评论

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

评论(3

雄赳赳气昂昂 2024-08-31 06:14:14

PyQt 和/或非常相似的诺基亚赞助的 PySide(具有更“宽松”的许可证,LGPL 而不是 GPL,以及相同的底层工具包 Qt)确实提供了与诺基亚的智能手机 GUI 工具包(你的第四点)——诺基亚收购了 Qt 的制造商 Trolltech,正是因为 Qt 是其移动产品的基本 GUI 工具包。

您提到的所有工具包都满足您对操作系统(Windows、Mac、Linux)提出的条件,这是您的第二点。

您的第一点和在某种程度上第三点在很大程度上取决于您为每个工具包提供的学习材料。根据我的口味,似乎 wxPython 的教程(wiki 形式的新教程就是我所指的并推荐)真的很好,而且 PyQt 一点也不差; PySide 的文档 不包含一个好的教程(据我所知),我相信 PySide 的目的是让您首先学习 PyQt (使用合理的可用材料),然后应用这些 在 PySide 中而不是 PyQt 中编程几乎没有什么区别;-)。我能找到的 Tkinter 教程要么非常古老,要么专注于底层工具包的多语言性质,我认为这使它们较差。

如果你买得起一本书,PyQt 有一本不错的书(也适用于 PySide,如上所述) -- 这个优秀且免费的不幸的是已经很老了,所以我不认为这有帮助。 wxPython自己的书也不错; tkinter 再次非常过时。

我个人推荐 PyQt / PySide:总体能力 A+,易于上手(使用上面的教程和书籍)A-,诺基亚手机程序员相似度 A。对于 wxPython,我会说能力 A,易用性 A,诺基亚相似度 B。 Tkinter 过时的教程和书籍是重要的负面影响。

您还提到了 Android,但我不明白有什么东西可以同时与 Android 和诺基亚的手机 GUI 编程类似。也许我对 Android GUI 编程不够熟悉,但在我看来,它与你提到的每一个工具包都不同。

PyQt and/or the very similar Nokia-sponsored PySide (with a more "relaxed" license, LGPL instead of GPL, and the same underlying toolkit, Qt) do offer the advantage of similarity with Nokia's smartphones GUI toolkit (your fourth point) -- Nokia purchased Trolltech, the makers of Qt, exactly because Qt was the fundamental GUI toolkit for their mobile offerings.

All the toolkits you mention satisfy the conditions you pose about operating systems (Windows, Mac, Linux), your second point.

Your first and to some extend third points depend in good part of what learning materials you have available for each of the toolkits. To my tastes, it seems that wxPython's tutorial (the new one in wiki form is what I'm pointing to and recommending) is really good, and PyQt's not bad at all; PySide's docs don't include a good tutorial (that I know of), I believe PySide's intention is that you first learn PyQt (with the reasonable available materials), then apply these few differences to be programming in PySide instead of PyQt;-). Tkinter's tutorials that I can find are either very old or focused on the underlying toolkit's multi-language nature, which I think makes them inferior.

If you can afford a book, PyQt has a good one (also applies to PySide, as above) -- this excellent and free one is unfortunately very old, so I don't think it helps. wxPython's own book is also quite good; tkinter's, again, is very dated.

Personally I recommend PyQt / PySide: overall power A+, ease to get started (with the above tutorial and book) A-, Nokia-phone programmer similarity A. For wxPython I'd say power A, ease A, Nokia-similarity B. Tkinter's dated tutorials and book are important negatives.

You also mention Android, but I don't see how anything could be similar to both Android and Nokia's phone-GUI programming at the same time. Maybe I'm not familiar enough with Android GUI programming, but it seems to me that it differs from every one of the toolkits you've mentioned.

千柳 2024-08-31 06:14:14

PyGTK 至少满足了前三点。我不确定第四个。这里有一个很好的教程: http://www.pygtk.org/pygtk2tutorial/index.html

PyGTK fufills at least the first three points. I'm not sure on the fourth. It has a nice tutorial here: http://www.pygtk.org/pygtk2tutorial/index.html

ぃ双果 2024-08-31 06:14:14

我猜您正在寻找Glade

该网站说:

Glade 是一款 RAD 工具,可实现快速、便捷的操作。方便用户开发
GTK+ 工具包和 GNOME 桌面环境的界面。

在 Glade 中设计的用户界面保存为 XML,并使用
GtkBuilder GTK+ 对象,这些可以由应用程序加载
根据需要动态地进行。

通过使用 GtkBuilder,Glade XML 文件可以用于多种用途
编程语言包括 C、C++、C#、Vala、Java、Perl、
Python 等。

我还是一个相当菜鸟程序员,但我在开始使用CGlade时遇到了一些问题。所以我猜你带着你的蛇在这里会跑得很顺利。看看吧。

I guess you are looking for Glade.

The site says:

Glade is a RAD tool to enable quick & easy development of user
interfaces for the GTK+ toolkit and the GNOME desktop environment.

The user interfaces designed in Glade are saved as XML, and by using
the GtkBuilder GTK+ object these can be loaded by applications
dynamically as needed.

By using GtkBuilder, Glade XML files can be used in numerous
programming languages including C, C++, C#, Vala, Java, Perl,
Python,and others.

I am a pretty noob programmer yet, but I am having just a few issues to get things started with C and Glade. So I guess you will run smoothly here with your snake. Take a look.

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