Tkinter vs wxPython

E

Esmail Bonakdarian

Greetings all.

I will have about 2 weeks to pursue some Python related activities and
would like to learn more about the graphical end of things. In that
vein I would like some opinions regarding Tkinter and wxPython.
(The previously recommended PyGame is appropriate for me for now, but
I am looking ahead)

I am especially interested in terms of learning curve, documentation,
portability across platforms Linux/Windows and anything else you care
to add. As I know only what I have read on this forum & surfing the
web I would really appreciate the input of those who have used both,
or decided to use one over the other.

Thanks a bunch,

Esmail

ps: this is basically the same query as posted December 10 “Re: GUIs:
wxPython vs. Tkinter (and others)”
 
E

Esmail Bonakdarian

My post wasn't complete, sorry for the additional post:

ps: this is basically the same query as posted December 10 “Re: GUIs:
wxPython vs. Tkinter (and others)” by Erik Johnson which really seemed
to end up comparing PyQt (?)
 
M

Michael McGarry

Esmail said:
My post wasn't complete, sorry for the additional post:

ps: this is basically the same query as posted December 10 “Re: GUIs:
wxPython vs. Tkinter (and others)” by Erik Johnson which really seemed
to end up comparing PyQt (?)
I recommend PyQt because of the easy to use designer progam that speeds
up GUI development. Designer allows you to design your UI visually and
establish handlers for events. It outputs a .ui file.

You then call 'pyuic myui.ui > myui.py' to turn your ui into a python class.

The Qt framework is very straightforward to use as well and
www.trolltech.com maintains good documentation on the framework.

Check it out: http://doc.trolltech.com/3.3/index.html

PS: You can also use your .ui files to output C++ classes with 'uic'
instead of 'pyuic'. I also think there is a 'puic' to create Perl code.
So, that single ui description can be used in multiple languages.

My two cents,
Michael
 
F

flaxeater

Esmail said:
Greetings all.

I will have about 2 weeks to pursue some Python related activities and
would like to learn more about the graphical end of things. In that
vein I would like some opinions regarding Tkinter and wxPython.
(The previously recommended PyGame is appropriate for me for now, but
I am looking ahead)

I am especially interested in terms of learning curve, documentation,
portability across platforms Linux/Windows and anything else you care
to add. As I know only what I have read on this forum & surfing the
web I would really appreciate the input of those who have used both,
or decided to use one over the other.

Well I would recomend Tkinter because it's the easiest to use. I
recomend using this document.
http://infohost.nmt.edu/tcc/help/lang/python/tkinter.html I used it
and just worked my way through it. I found it very useful.
 
S

Steve Holden

Michael said:
I recommend PyQt because of the easy to use designer progam that speeds
up GUI development. Designer allows you to design your UI visually and
establish handlers for events. It outputs a .ui file.

You then call 'pyuic myui.ui > myui.py' to turn your ui into a python
class.

The Qt framework is very straightforward to use as well and
www.trolltech.com maintains good documentation on the framework.

Check it out: http://doc.trolltech.com/3.3/index.html

PS: You can also use your .ui files to output C++ classes with 'uic'
instead of 'pyuic'. I also think there is a 'puic' to create Perl code.
So, that single ui description can be used in multiple languages.

My two cents,
Michael

Michael:

Just a bit less-than-helpful when the original post specifically asked
for comparisons *between Tkinter and wxPython* in the context of having
two weeks to work on *Python* ;-)

regards
Steve
 
P

Peter Hansen

Esmail said:
I will have about 2 weeks to pursue some Python related activities and
would like to learn more about the graphical end of things. In that
vein I would like some opinions regarding Tkinter and wxPython.

This is an area where personal preference reigns strong.
You really ought to try both out. Following through a
tutorial or examining some example code and trying to
make a few changes on your own will give you a far better
perspective than anything you learn from others here.

For example, I see "flaxeater" has just said that Tkinter
is "the easiest to use". I, however, found it anything
but, and had no end of trouble figuring out how to make it
do the things I wanted. In spite of its "better" documentation,
too, I might add.

When I switched to wxPython, I faced some of the typical
wxPython issues (the docs simply aren't as good), and yet
I was able to make progress faster and get closer to my
goals. The demo program, for example, is worth its weight
in gold. (Well, bad analogy in the computer world. :-( )

Try them both out for an hour or two, and go with whichever
one "feels right". You very likely won't be making a mistake.

-Peter
 
E

Esmail Bonakdarian

Hi

I have found ALL of the posts useful, thank you so much.

Please keep them coming! I am learning a lot.

I will probably play a bit with Tkinter and wxPython and see how
each feels, just as Peter Hansen suggested). PyQt also looks
interesting, so I will take a look at that at some point down the
line aswell.

Thanks again, this is a great resource.

Esmail
 
F

F. GEIGER

Esmail Bonakdarian said:
Hi

I have found ALL of the posts useful, thank you so much.

Please keep them coming! I am learning a lot.

I will probably play a bit with Tkinter and wxPython and see how
each feels, just as Peter Hansen suggested). PyQt also looks

It couldn't have been said better than Peter has.

I might add this: Try both *and learn both*. Despite the fact, that I do
most GUI stuff with wxPython, I sometimes face situations, where I need to
be able to do some Tkinter stuff (mostly by use of PMW). This could happen
to you too, more likely than you might think now.

As for the wxPython path: I recently prototyped a GUI-app for Windows with
wxPython and then (alas) had to port it to C++. I simply could download the
wxWidgets (which wxPython is built upon) and kind of simply translate the
Python stuff into C++! It really helped me *a lot* having a working
wx/Python app, and saved me a lot of time, of course (but no as much as I
had saved, if I hadn't to port it to C++).

And while I am at it: It was a big benefit for me to *not* use a GUI builder
(which could be the next thing you might ask for), when I started Python
programming. When I started Python programming with 1.5.2 there wasn't a
descent GUI builder for wx (or at least I couldn't find one). And today,
where there are a few options (wxDesigner, Boa, to be concrete), I'm really
glad never having used one: Everything I do is under *my* full control, and
I guess this is the only way to get the most out of wx/Python. And for sure,
it's the only way knowing what you do.

As Peter said, the wxPython demo is a bonanza - use it.

Summary: Taking all my experience into account, I'd advise you to learn
Tkinter, to learn wxPython and to not use a GUI builder (which could be not
what a newbie likes to hear).

HTH
Franz GEIGER

P.S.:
Concerning PyQt: Yes, so far I only can speak for Tkinter and wxPython. But
as soon as I will be on Linux (hopefully next year), I'll try PyQt. So if
you would have asked me next year, I had said (phew, is that correct
English?): Learn Tkinter and wxPython and/or PyQt and no GUI builder :)
 
M

Michael McGarry

Definitely look at PyQt. It was the GUI framework I chose when going
through the same process 3 weeks ago. I have to disagree with F.Geiger
(sorry, F.Geiger), I think a GUI builder is a necessity. It saves you a
lot of time. The alternative is to keep changing your code until your
GUI looks as you want. With a GUI builder you "draw" what you want and
have the tool generate the Python class for the GUI. It also sets up
event handlers for you too.

Visual elements are best designed visually!!!
 
M

M.E.Farmer

I have to agree with F. Gieger learning to code a framework by hand
only helps you.
Sure wxGlade/Boa/etc can help speed design and layout up, but what
happens when you want to do non standard things or just get stuck
because some thing just isn't working.
Check recent threads .....All the newbies needing help are using
wxGlade or Boa and it helps them get neck deep into trouble before they
even realize what they are doing wrong.
Because they have not worked directly with the framework they don't
understand the framework . But YMMV
M.E.Farmer
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,045
Latest member
DRCM

Latest Threads

Top