views:

14732

answers:

20

I am considering creating a GUI-based tool that I want to be cross-platform. I've dismissed Java, as I personally do not like Swing. I'm currently considering C# and using Mono to make it cross-platform. However I'm wondering whether new-fangled cross-platform languages like Python can offer me a decent GUI development environment.

+9  A: 

You could try PyQt This uses the Qt toolkit for the GUI but you write your program in python.

Qt Designer can be used to create GUIs graphically for use with PyQt

David Dibben
I don't see anything on that site that talks about the IDE working for GUI building, being written with PyQt and being an IDE for it are two different things. Have you used it to actually develop a GUI app? If so, how is it for that?
Joe Skora
@Joe Skora Qt Designer is the GUI building application for Qt. The python bindings for Qt are fine. If you want to take a look at current Qt applications you may checkout Google Earth and Skype.
Vitor Py
+9  A: 

There are excellent GUI options for Python. wxPython is a great place to start, pyQT is good if you have spare money.

The biggest issue I've seen is having a tool that lets you layout a form with the ease of Visual Studio -- but I think pyQT has that one resolved, and wxWindows has a version you can pay for.

torial
+2  A: 

Go for it. I think you will find it an easier cross platform route than C#+Mono. Check out Tkinter, the Python interface to Tcl/Tk. Tkinter is available for Unix, Windows and Macintosh. It has been a while but as I recall there were a couple of well done IDEs for development and GUI layout.

pdavis
Tk is so easy you don't really need an IDE for doing GUI layout. Get yourself a piece of graph paper and a good pencil. That's not tongue-in-cheek: it really is easy to do layouts in Tk -- I've yet to find a toolkit that is easier (though admittedly, I've only used a half dozen or so professionally)
Bryan Oakley
+4  A: 

I've actually done similar research lately as many of the artist I work with work on Macs. What I found is that wxPython seems pretty robust. My goals were for internal tools development, so I was looking for a more efficient development language than C# and Java.

I'm not an expert in wxPython, but if you are interested in GUI development in Python, I would give this API a try, or at least some research time.

Fostah
+4  A: 

Python is excellent for gui development
Speed of execution is less important than speed of development, GUIs change a lot. GUIs generally involve dealing with text and storing state - ideal pythonisms
If your app is in c++/c#, then having the gui written in a different langauge enforces gui/logic separation.

Options are: wxpython/pyQT - equally good, all the functionality of wx/qt from python, both the designers can spit out native python implementations.

IronPython - .net implmentation of python so all winforms and wpf directly from python. You get all the .net libs but only a subset of the native python ones, but it is very easy to mix python gui with other parts of the app writen in c# etc.

Martin Beckett
How exactly does writing in C++/C# enforce GUI/logic seperation?
Jon Cage
I mean't that having the gui written in a different language enforces separation (I clarified the post)
Martin Beckett
Fair point then :-)
Jon Cage
+1  A: 

You should take a look at IronPython. With it you can use the .NET Framework and I'm pretty sure somehow Mono too!

http://www.google.de/search?hl=en&pwst=1&sa=X&oi=spell&resnum=0&ct=result&cd=1&q=ironpython&spell=1

Sebastian Hoitz
IronPython is excellent. Making a first class GUI in WinForms/WPF inside of Visual Studio and then using it with IronPython is just simply the best GUI solution out there.
Finglas
+59  A: 

I've made numerous UI's in wxPython and would highly recommend it. I used to build in VisualC++/MFC then discovered wxWidgets/C++ and finally moved onto wxPython. I find I'm able to get working GUIs in no time at all with wxPython compared to the other methods and with almost no effort, the same source works works on Linux and the Mac* (sometimes you need some tweaks for visual anomolies).

*I generally develop under Windows in case you hadn't guessed.

[Edit] There's a tool (wxDesigner) you can use to generate the layout for you or alternatively, you can play with it programmatically. Either way, layout under wxWidgets is done using Sizers. They're quite a powerful way of laying out a GUI and once set up correctly, will automatically resize your controls appropriately for you.

[Edit2] There's a nice little tutorial on sourceforge with some good examples of what you can do with sizers.

[Edit3] There's another tool (wxGlade) I've just discovered which does what wxDesigner does, but for free from a quick trial, might actually be better as well.

Jon Cage
Too sad. Still no wxPython for Python 3.
Selinap
The link to wxDesigner is dead.
Gabb0
I've fixed the link.
Jon Cage
I find the wx sizer thing odd. I'm used to VB/Delphi style GUI layout, and found the sizer thing almost unusable. It just goes to show that "any good for GUI programming" is pretty subjective. For me, I can not find anything I like using to make guis with python. I find tkinter glitchy, wx unintuitive, and everything else worse.
Warren P
@Warren P: Give wxDesigner a try; you can drag and drop elements onto the gui in the same way that you can in VB.
Jon Cage
+25  A: 

wxPython is the best and most mature cross-platform GUI toolkit, given a number of constraints. The only reason wxPython isn't the standard Python GUI toolkit is that Tkinter was there first.

-- Guido van Rossum

From http://www.wxpython.org/quotes.php

miya
While I respect his opinion greatly, he doesn't strike me as the sort of person that does very much GUI programming. If I didn't do much GUI programming I'd vote for wxPython too. It has more eye candy, but I'm not convinced it's superior to Tkinter.
Bryan Oakley
+6  A: 

To asnwer your question directly:

Yes, Python is excellent for GUI development. Python is dynamic and extremely flexible, traits that are very important for GUI development where one often needs to write a lot of boilerplate code. The bindings for some popular cross-platform GUI libraries (wx, Qt, etc.) are mature, stable, actively developed and well supported.

I've found performance of Python GUI bindings to be good (I'm personally using wxPython and have already written a few functional GUIs both for work and personal use). But if you want to improve it even further, I'm sure it's not too hard to combine the Python binding code with C++ code (using the wxWidgets C++ libarary itself, for instance). Anyhow, I suspect this won't be a problem for you.

Eli Bendersky
+3  A: 

wxPython is full of bugs on anything besides Windows. PyGTK2 is probably the best GUI toolkit but I don't know on what platforms it is supported, probably everywhere gnome is.

Vasil
GTK looks horrible (or if you prefer, different) and is unintuitive on Windows and Mac.
Turtle
+1  A: 

I personally find wxPython to be very clumsy. I've encountered many bugs while trying to use it and the backwards compatibility issue is quite bothersome. I guess that's a complaint about python in general though.

Edit: More specifically, you have to actually uninstall a current version of python and install an old version to get some programs to work properly. I believe it was one of the programs I was using with Z/Eves. It's been a few years.

Joe Philllips
What problems specifically?
FogleBird
Not sure I ever heard such a general "complaint about Python"…
EOL
+2  A: 

Check out the Traits library from Enthought. It's a way of describing different properties of objects, views of those properties, and dynamically updating views. I'm not really doing it justice, but it's an extremely flexible, rapid-development library. Plus, it leads to reusable and extensible code. I've written a couple minor scientific applications in Traits, and I have found it to be an absolute dream, as it lets me focus on the data model rather than the UI.

A: 

I belive that Chandler ( the Calendar sharing app from Mitch Kapors Open Source Applications Foundation - http://www.chandlerproject.com) is written entirely in Python and wxWidgets.

Can't add anything else as I'm not a Python guy.

Roberto Bonini
+6  A: 

As others have said, wxPython is a good GUI library. One thing that isn't mentioned much is that you can combine wxPython with wxGlade to create many "drag and drop" programs.

wxGlade lets you quickly create the framework of your program; you don't have to worry about any of the working code at first. You can just create the visual look until you get it just right. Once that's done, then you start working on the actual coding, but you already have the GUI framework laid out for you. All you have to provide is the programming logic to make your application work.

One benefit of using Python for applications in general is the interpreted environment. You don't have to do the check/compile/run cycle everytime. You can quickly make changes and see them nearly instantaneously, which greatly speeds up development.

Additionally, if you need to speed up the program, you can always write certain parts in C/C++ and pre-compile them. The cPickle module is an example of this. But for many GUI programs, the application will be waiting on the user so speed is usually not an issue.

crystalattice
+1  A: 

Dabo is a Python framework for cross-platform GUI app development. It starts with wxPython for the UI, but completely wraps it in order to eliminate the ugliness and inconsistency that comes with wxPython.

Check out some of the screencasts of Dabo in action at http://dabodev.com/documentation

Ed Leafe
A: 

With jython you could use Java Swing. 100% cross platform and everybody loves swing - right ;-)

johnstok
Everybody loves Swing, except OP :)
Constantin
+5  A: 

Another good wxPython tutorial:

http://zetcode.com/wxpython/

Federico Ramponi
+2  A: 

I made a similar/related question a while ago, might serve as reference:

http://stackoverflow.com/questions/520015/cross-platform-gui-toolkit-for-deploying-python-applications

nachik
A: 

there are numerous gui toolkits availabe for python,like tkinter,pyqt,pygtk,wxwidgets etc

appusajeev