How to get started in GUI Programming?

P

peter.mosley

I am trying to learn GUI programming in Python, but have to confess I
am finding it difficult.

I am not an experienced programmer - just someone who from time to
time writes small programs for my use. Over the years I have moved
from GWBASIC to QBASIC to Visual Basic, and now trying to move across
to a Linux platform. Python seems to be the best compromise between
the limitations of command line basic programming and the total
incomprehensibility of C.

Googling around it seems the best GUI is either Tkinter or PyGtk. I
found a book which recommended PyGtk, as it had a graphical design
option, Glade. Coming from a VB background I latched onto that and
bought the book (Beginning Python, Wrox), but it was a disappointment
(or more accurately a complete waste of money) - there was
insufficient detail in the text.

I've found the tutorial and reference manual on the PyGtk web site,
but although I've made some progress, I keep reaching points where I
have insufficient background to understand them. Currently I'm stuck
on dialog boxes (the code seems immensely complex for the equivalent of
MsgBox("Do you really want to do this ",vbYesNo) and I haven't
got it to work properly yet) and loading graphical images in anything
other than their original size, but every new step brings another
struggle

I've seen reference to a Tkinter book - something like 'Python
and Tkinter Programming' but it seems to be out of print and
unavailable.

Can anyone offer any suggestions as to the least painful way forwards?

(Email address was valid once but has long since been abandoned to
spam. Please rely via newsgroup)
 
T

Thomas Guettler

Am Fri, 25 Nov 2005 06:02:40 -0800 schrieb peter.mosley:
I am trying to learn GUI programming in Python, but have to confess I
am finding it difficult.

Yes, if you come from Visual Basic you might be missing something.
I developed with Visual Basic some time ago and like some parts of it.

I've found the tutorial and reference manual on the PyGtk web site,
but although I've made some progress, I keep reaching points where I
have insufficient background to understand them. Currently I'm stuck
on dialog boxes (the code seems immensely complex for the equivalent of
MsgBox("Do you really want to do this ",vbYesNo)

search for yesNoDialog here:
http://guettli.sourceforge.net/gthumpy/src/editMetadata.py
and I haven't
got it to work properly yet) and loading graphical images in anything
other than their original size, but every new step brings another
struggle

search for scale2pixbuf in the link.
Can anyone offer any suggestions as to the least painful way forwards?

Only the beginning is painful. After some time you don't miss anything
from Visual Basic anymore.

Happy Learning,
Thomas
 
P

Peter Decker

On 11/25/05 said:
I'd go for wxPython ;-)

I'd go for Dabo, which is a Pythonic wrapper around wxPython. They are
even working on a visual design tool to lay out your UI, much as you
would in Visual Basic.
 
U

UrsusMaximus

Hello Peter,

I am going to recommend EasyGui which can be found at
http://www.ferg.org/easygui/ because it is (by far) the easiest
possible GUI creation tool using Python.

If (or when) your needs require more complex options than easygui
provides, you might try looking at my GUI toolkits page,
http://www.awaretek.com/toolkits.html which has short descriptions of
and links to several Python GUI toolkits. Among these, my personal
favorite is PythonCard which is a framework that uses a visual GUI
creation tool and uses the wxPython widgets. I have found PythonCard to
be much easier to get started with than Glade.

I also did a podcast describing Python's GUI options, from a beginner's
point of view, which can be found on my Python podcasts page,
http://www.awaretek.com/python/index.html (scroll down to near the
bottom to find the "Choose Your GUI Toolkit" podcast from back in July.


But by all means don't forget to check out Easygui. Steve Ferg has made
a tool that is incredibly simple to learn and use, and sometimes it
sure is nice to get instant gratification by achieving quick success
and useful results. ;-)))

Ron Stephens
<a href="http://www.awaretek.com/plf.html">Python Learning
Foundation</a>
 
F

flamesrock

The best, in my opinion is wxPython.

I recommend getting wxGlade and just fiddling around. You should be
able to produce some interesting GUI's fairly easily.
 
D

David Boddie

I am trying to learn GUI programming in Python, but have to confess I
am finding it difficult.

I am not an experienced programmer - just someone who from time to
time writes small programs for my use. Over the years I have moved
from GWBASIC to QBASIC to Visual Basic, and now trying to move across
to a Linux platform. Python seems to be the best compromise between
the limitations of command line basic programming and the total
incomprehensibility of C.

Googling around it seems the best GUI is either Tkinter or PyGtk.

You might also want to try PyQt:

http://www.riverbankcomputing.co.uk/pyqt/

I'm sure fans of wxWidgets will also point you in the direction of
their favourite bindings. ;-)

David
 
T

Thomas Guettler

Am Fri, 25 Nov 2005 06:02:40 -0800 schrieb peter.mosley
I am trying to learn GUI programming in Python, but have to confes
am finding it difficult
Yes, if you come from Visual Basic you might be missing something
I developed with Visual Basic some time ago and like some parts of it
I've found the tutorial and reference manual on the PyGtk web site
but although I've made some progress, I keep reaching points where
have insufficient background to understand them. Currently I'm stuc
on dialog boxes (the code seems immensely complex for the equivalen o
MsgBox("Do you really want to do this ",vbYesNo
search for yesNoDialog here
http://guettli.sourceforge.net/gthumpy/src/editMetadata.p
and I haven'
got it to work properly yet) and loading graphical images i anythin
other than their original size, but every new step brings anothe
struggl
search for scale2pixbuf in the link
Can anyone offer any suggestions as to the least painful wa forwards
Only the beginning is painful. After some time you don't miss anythin
from Visual Basic anymore

Happy Learning
Thoma
 
M

malv

I suggest you take a look at Qt3, much superior to Tkinter or PyGtk.
With Python, you have to use PyQt bindings.
 
B

Bill

I am trying to learn GUI programming in Python, but have to confess I
am finding it difficult.

Googling around it seems the best GUI is either Tkinter or PyGtk.

This statement is, and has been subject to much debate. If you ask 10
people on this newsgroup you'll probably get 12 opinions.

If you're having trouble at this early stage, you might want to
reconsider and take another look at either QT or wxWidgets. I've been
through the QT tutorial and was quite satisfied with it, although I'll
admit I was not a GUI newby at the time. I also found the tutorial
accompanying Boa Constructor (http://boa-constructor.sourceforge.net/)
to be a good start at creating a wxWidgets GUI.

Bill
 
J

jay.dow

did you search GUI in this group? I think the results will be helpful.
some other GUI packages you might of missed are wxPython and pygame
 
B

BartlebyScrivener

I am trying to learn GUI programming in Python, but have to confess I
am finding it difficult.

I am not an experienced programmer - just someone who from time to
time writes small programs for my use. Over the years I have moved
from GWBASIC to QBASIC to Visual Basic, and now trying to move across
to a Linux platform. Python seems to be the best compromise between
the limitations of command line basic programming and the total
incomprehensibility of C.

Googling around it seems the best GUI is either Tkinter or PyGtk. I
found a book which recommended PyGtk, as it had a graphical design
option, Glade. Coming from a VB background I latched onto that and
bought the book (Beginning Python, Wrox), but it was a disappointment
(or more accurately a complete waste of money) - there was
insufficient detail in the text.

I've found the tutorial and reference manual on the PyGtk web site,
but although I've made some progress, I keep reaching points where I
have insufficient background to understand them. Currently I'm stuck
on dialog boxes (the code seems immensely complex for the equivalent of
MsgBox("Do you really want to do this ",vbYesNo) and I haven't
got it to work properly yet) and loading graphical images in anything
other than their original size, but every new step brings another
struggle

I've seen reference to a Tkinter book - something like 'Python
and Tkinter Programming' but it seems to be out of print and
unavailable.

Can anyone offer any suggestions as to the least painful way forwards?

(Email address was valid once but has long since been abandoned to
spam. Please rely via newsgroup)

I responded twice to this but it didn't post. Weird. Anyway, search for
PythonCard and wxPython in this group. And then, for more options,
check this page:

http://www.fredshack.com/docs/python.html

bs
 
J

jmdeschamps

It all really depends on what you wish to achieve. Results are
generally in proportion to the effort involved.
I don't think a "Python for Nulls" exists !
the following thread deals with documentation for beginners (and others
as well)
http://groups.google.ca/group/comp....128fa/2b6b186a96c4fa73?hl=en#2b6b186a96c4fa73

For Tkinter the basic document is Fredrik Lundh's 'Introduction to
Tkinter' (you can google to easily find this)
and also one from New Mexico Tech at
http://infohost.nmt.edu/tcc/help/lang/python/tkinter.html

If you're intent on doing image manipulation, I would advise that you
consider the Python Imaging Library (known as PIL).

Pain is a very personal concept - what can be a painful endeavor for
some might be a enticing challenge for another ;-)

Good luck.
 
G

gsteff

I learned pygtk via the tutorial and reference manual, and found most
things to be pleasantly simple to do. A message dialog, for example,
can be done via

dialog = gtk.MessageDialog(buttons=gtk.BUTTONS_OK_CANCEL,
message_format="Test message here.")
response = dialog.run()

All that can be found by looking up the MessageDialog class in the
reference manual, noticing that there's not much there, and looking
and the documentation for its parent "Dialog" class. That may be one
source of confusion you may have experiened while reading the reference
manual.

In general, I've found pygtk to be remarkably pythonic (for an
interface to a library that has been ported to many other languages as
well). For example, when using tree views, you can access the tree
model underlying it using the normal python list syntax, which I think
is very cool. If you have other examples of things that are confusing,
post them (here, or to the pygtk list).

Greg
 
L

Luis M. Gonzalez

IMHO, the easier alternative for building GUI apps with Python is
PythonCard.
It is based on wxWindows, and it lets you build gui apps by dragging
and dropping widgets on a form, just like VB or Delphi. It is very high
level and very easy to learn and use.

http://pythoncard.sourceforge.net/

Another alternative, also based in wxWindows, is Boa Constructor, but I
wouldn't recomend it over Pythoncard.

Good luck!
Luis
 

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

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top