开发者

How's Python GUI development today (Sep/2010)?

Last time I saw, GUIs in Python were extremely ug开发者_JS百科ly, how's it today?

(saw some beautiful images on google images, but I don't know if are really Python's)


Python 2.7 and 3.0 ships with the themed tk ("ttk") widgets which look much better than previous versions of Tk (though, honestly, any competent GUI developer can make even older Tk look good). Don't let the people who don't know much about Tk sway you from using it, it's still a very viable toolkit for many, many tasks. You won't be creating a Photoshop clone with it, but how many people write those kinds of apps anyway?

I've been using wxPython for the past year and would still choose Tkinter over it for most tasks. Tkinter is much simpler and in many respects more powerful. The only advantage wxWidgets has is that it has more built-in widgets, but I find many of them a bit buggy and hard to use. For most apps that most people will write, Tkinter is still an excellent choice.

Some screenshots of themed widgets are available here:

http://code.google.com/p/python-ttk/wiki/Screenshots

Here's a screenshot of a Tkinter app that uses the themed widgets on the Mac:

http://www.codebykevin.com/phynchronicity-running.png


Tk is sill is the default GUI toolkit for Python, but it has a theme support from Python 2.7/3.1. It is not as ugly as before.

However, you can use some nice alternatives which still look better (IMHO) and have more functionalities :

  • wxPython : maybe the most used, cross platform and all, your applications will look the same as native.
  • PyQt or soon PySide : bindings for the Nokia Qt open source framework. There is more than just a GUI toolkit.
  • PyGTK : bindings for the GTK+ libraries

Here is more info : http://wiki.python.org/moin/GuiProgramming


Python has bindings for Tk, Qt, GTK, wx, and many more. There's no reason it should be any uglier than another language. You're probably thinking of a gui made with Tk, which has a reputation of being ugly. It's not specific to python, but it might be more common because it's very simple and ships with python by default.

See Gui Programming on the python wiki for more info.


I Think the latest Tkinter version offers native look for Macos. WxPython and QT offers native look for macos,windows and linux. GTK is abit ugly and prone to crashes on mac cause of the X11 implentation there.

Of course you could build your own GUI , that something I am trying to do with pygame.Let me clarify , I am not making a GUI library just GUI for my own application. I am making the graphics in the 3d app Blender.

My vote for Generic GUI goes to wxPython, tried it, looks great, easy to use and works like a charm across platforms. You will also find tons of info about it. Integrates well with opengl so if you want to do extreme guis on it , it can do them.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜