views:

128

answers:

5

Hey guys

I want a simple gui for one of may apps and am a noob when it comes gui itself. Tkinter and wxpython are the two standards in python i see.. Which one is simpler and more intuitive?

A: 

For create interface in python you may use PyQT. May be it simple for you.

Evgeniy
+1  A: 

Tkinter is much simpler. But wxpython provides more flexibility. Try-out wxGlade, you might like it.

lalli
+3  A: 

Tkinter has hardly changed over the years is very stable. wxPython comes as a good alternative.

Some discussions that may be of interest to you while choosing between Tkinter and wxPython

Here is a comparison side by side of building a simple GUI in Tkinter as well as wxPython. Take a look at it and it might help you in deciding what seems a better abstraction and to your liking.

Also wxPython comes with some GUI builder that may help you create a simple app faster and get done with.

pyfunc
+1  A: 

A) If you only need to communicate with the user with dialogs, file selectors, etc. then use EasyDialogs for windows. You don't need to know anything about GUI's for that.

> import EasyDialogs
> work_file = EasyDialogs.AskFileForOpen()

Alternatively if you are not in windows or even if you are, check EasyGui. Very similar although for very simple things I prefer EasyDialogs because the look is better.

B) If you need something more sophisticated but still dont want to mess too much with GUI frameworks, try wxpython with griggio's wxglade. With wxglade you can make a GUI very easily coding only a minimum part of the thing and avoiding most of the boilingplate. Get wxglade from bitbucket, it is the more stable one.

C) if you need something more sophisticated, take wxpython or pyQt.

D) if you need something more sophisticated in python 3.x, go for pyQt.

joaquin
A: 

I find Tkinter to be considerably easier to use than wxPython. It also crashes less frequently than wxPython. I can't remember the last time I saw Tkinter crash on me. With wxPython, it was yesterday. And a few times last week.

wxPython has more built-in widgets, but there's really not much more there than what you can do in Tkinter with a little work. However, as a beginner you might find all the built-in widgets to be a time saver.

One thing I find extremely frustrating with wxPython is the layout managers. In Tkinter, you have three choices: want lay things out in a grid? Use grid. Lay things out in a box? Use pack. Want absolute positioning (rarely needed...), use place.

For wxPython you have to choose between BoxSizer (in horizontal and vertical flavors), StaticBoxSizer, GridSizer, FlexGridSizer, GridBagSizer, or absolute positioning with widget attributes. With the three Tkinter managers I can do as much or more with fewer lines of code than I can with all of the various wxPython managers.

Tkinter also has a better event processing model IMO. There's simply no equal to Tk's bindtags mechanism in any other toolkit. All bindings are pretty much handled the same (versus wxPythons distinction between accelerator events, command events and non-command events). Bindings are simple, intuitive, and very flexible with Tkinter.

To say something good about wxPython, most people think that wxPython looks better than Tkinter. With modern versions of tk (python 2.7 and above) the gap narrows with the introduction of themed widgets to Tk.

So, for simplicity sake I recommend Tkinter. All of the basic functionality is there if you're using python 2.7 or above. It's simple, easy, fairly well documented.

Bryan Oakley
Sounds like you just aren't good at wxPython or haven't spent enough time with it. wxPython is actually clean and simple and I don't have issues with it crashing.
FogleBird
I agree with FogleBird. For example, the number of choices in Sizers is a red herring... Having 4 choices instead of 3 (since the StaticBox is something else) isn't really so awful, is it? Just learn what they are for and how to use them.
K. Brafford
@FogleBird: it depends on your definition of "enough time". I've got maybe 6 months full time invested in it, spread over a year or so. I personally believe I have enough experience to know they are inferior to Tk's pack and grid.
Bryan Oakley
@FogleBird: I envy your lack of experience with wxPython crashing. Maybe it's because I'm using an older version. But honestly, during development I get seg faults surprisingly often.
Bryan Oakley
Weird...I've been using wxPython for 4+ years and I rarely get segfaults. I agree that Tkinter is more "pythonic" and probably easier to learn for a new guy, but I really like wxPython.
Mike Driscoll