문제

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.

도움이 되었습니까?

해결책

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.

다른 팁

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

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top