How to get started in GUI Programming?

Discussion in 'Python' started by peter.mosley@talk21.com, Nov 25, 2005.

  1. Guest

    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)
    , Nov 25, 2005
    #1
    1. Advertising

  2. enlightened us with:
    > Googling around it seems the best GUI is either Tkinter or PyGtk.


    I'd go for wxPython ;-)

    Sybren
    --
    The problem with the world is stupidity. Not saying there should be a
    capital punishment for stupidity, but why don't we just take the
    safety labels off of everything and let the problem solve itself?
    Frank Zappa
    Sybren Stuvel, Nov 25, 2005
    #2
    1. Advertising

  3. 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


    --
    Thomas Güttler, http://www.thomas-guettler.de/
    E-Mail: guettli (*) thomas-guettler + de
    Spam Catcher:
    Thomas Guettler, Nov 25, 2005
    #3
  4. Peter Decker Guest

    On 11/25/05, Sybren Stuvel <>

    > 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.

    --

    # p.d.
    Peter Decker, Nov 25, 2005
    #4
  5. Szabolcs Nagy, Nov 25, 2005
    #5
  6. Steve Guest

    Steve, Nov 25, 2005
    #6
  7. Guest

    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>
    , Nov 25, 2005
    #7
  8. pdalet Guest

    If you come from visual basic, I suggest to use pythoncard GUI, which
    is
    very simple to develop with a Ressource Editor (create a panel, see
    labwindows, visual basic ..).

    https://sourceforge.net/projects/vb2py/
    a package to transform VB to pythoncard

    http://www.linux2000.com/pimp.html
    a pythoncard application


    Philippe DALET
    Lyp champollion
    46100 FIGEAC
    FRANCE


    a écrit :

    > 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)
    pdalet, Nov 25, 2005
    #8
  9. flamesrock Guest

    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.
    flamesrock, Nov 25, 2005
    #9
  10. BartlebyScrivener, Nov 25, 2005
    #10
  11. David Boddie Guest

    wrote:
    > 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
    David Boddie, Nov 25, 2005
    #11
  12. 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

    --
    Thomas Güttler, http://www.thomas-guettler.de
    E-Mail: guettli (*) thomas-guettler + d
    Spam Catcher:
    Thomas Guettler, Nov 25, 2005
    #12
  13. malv Guest

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

    wrote:
    > 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)
    malv, Nov 25, 2005
    #13
  14. BartlebyScrivener, Nov 25, 2005
    #14
  15. Bill Guest

    wrote:
    > 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
    Bill, Nov 25, 2005
    #15
  16. Guest

    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
    , Nov 25, 2005
    #16
  17. wrote:
    > 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
    BartlebyScrivener, Nov 25, 2005
    #17
  18. Guest

    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.
    , Nov 25, 2005
    #18
  19. gsteff Guest

    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
    gsteff, Nov 25, 2005
    #19
  20. 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
    Luis M. Gonzalez, Nov 26, 2005
    #20
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. George
    Replies:
    3
    Views:
    335
    George
    Apr 30, 2004
  2. xarax
    Replies:
    4
    Views:
    372
    Darryl L. Pierce
    Nov 26, 2003
  3. Ernesto
    Replies:
    8
    Views:
    365
    Larry Bates
    Jul 27, 2005
  4. Jake Barnes
    Replies:
    2
    Views:
    309
  5. Jai
    Replies:
    99
    Views:
    614
    Joshua Landau
    Dec 26, 2013
Loading...

Share This Page