Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > GUI tutorial

Reply
Thread Tools

GUI tutorial

 
 
John K Masters
Guest
Posts: n/a
 
      05-13-2007
Can someone point me in the direction of a good tutorial on programming
python with a GUI? I'm just starting out with python and have written a
few scripts successfully but would like to add a graphical front end to
them to make it easier for my work colleagues, most of whom have never
used a command line, to use.

Regards, John
--
War is God's way of teaching Americans geography
Ambrose Bierce (1842 - 1914)
 
Reply With Quote
 
 
 
 
Paul Rubin
Guest
Posts: n/a
 
      05-13-2007
John K Masters <> writes:
> Can someone point me in the direction of a good tutorial on programming
> python with a GUI? I'm just starting out with python and have written a
> few scripts successfully but would like to add a graphical front end to
> them to make it easier for my work colleagues, most of whom have never
> used a command line, to use.


http://infohost.nmt.edu/tcc/help/pubs/tkinter/ is pretty good. You
could alternatively consider writing your script as a web server or
web app, so the gui would be a browser. That puts some limitations on
the gui design but it makes development and deployment both simpler.
Develoment is simpler because you just use regular HTML instead of
weird libraries and callbacks and threads and all that crap.
Deployment is simpler because you can install and run the program on
one machine, send the url to your colleagues, and update the program
as needed without having to get your colleagues constantly installing
new versions. For security reasons, be careful to not expose the web
interface to the public internet until you know what you're doing.
 
Reply With Quote
 
 
 
 
vasudevram
Guest
Posts: n/a
 
      05-13-2007
On May 13, 10:51 pm, John K Masters <johnmast...@oxtedonline.net>
wrote:
> Can someone point me in the direction of a good tutorial on programming
> python with a GUI? I'm just starting out with python and have written a
> few scripts successfully but would like to add a graphical front end to
> them to make it easier for my work colleagues, most of whom have never
> used a command line, to use.
>
> Regards, John
> --
> War is God's way of teaching Americans geography
> Ambrose Bierce (1842 - 1914)



That depends on which GUI toolkit you want to use.

There are at least one or two good online tutorials on the Web for
Tkinter (the Python interface to the Tk toolkit).
One is by Fredrik Lundh (a.k.a the effbot, a leading Python
contributor). Google for suitable keywords, e.g. Tkinter tutorial.

Tkinter comes with Python by default on Windows, so that helps. But
wxPython is not a bad toolkit either.
(You'll have to download and install it, also the demos (see below)
are often a separate download.)
I've used it some, and like it. I don't know of any tutorials for it,
though there may be some - again, Google for info.
But if you already have some GUI programming background, its not too
difficult to pick up it up. It comes with a big set of demos with
source code, and I was able to learn enough wxPython to write some
simple apps just by looking at the demos source code and reading some
of the reference documentation. Those apps are here:

http://www.packtpub.com/article/Using_xtopdf

Check the last part of the article for links to the source code.

PyQt is another option, recommended by some people. Haven't tried it
myself but have used Qt (the C++ GUI toolkit to which PyQt is a
binding) a little, and like it a lot. Qt again is supposed to be of
very high quality, according to some people. I am currently reading a
book Programming Qt and found most of it pretty straightforward
(though not simple to understand (you do need to understand the
concept of signals and slots, as that is fundamental to Qt
programming).

HTH
Vasudev Ram
Dancing Bison Enterprises
http://www.dancingbison.com


 
Reply With Quote
 
Ivan Voras
Guest
Posts: n/a
 
      05-13-2007
John K Masters wrote:
> Can someone point me in the direction of a good tutorial on programming
> python with a GUI? I'm just starting out with python and have written a
> few scripts successfully but would like to add a graphical front end to
> them to make it easier for my work colleagues, most of whom have never
> used a command line, to use.


If you're using Linux or some other unix-like platform, try PyGTK:
http://www.pygtk.org/pygtk2tutorial/index.html


(Yes, it can run on Windows, but it tends to be more complicated there).

--
(\__/)
(O.o)
(> < )

This is Bunny.
Copy Bunny into your signature to help him on his way to world domination!


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.4 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGR5ShldnAQVacBcgRAhGGAJ9UEQwyHgMZc4S1K3OSWd 74uq6zaQCgxGx9
5OXpBe8TyrWCCvJyjQh6SdY=
=A1Do
-----END PGP SIGNATURE-----

 
Reply With Quote
 
BartlebyScrivener
Guest
Posts: n/a
 
      05-14-2007
On May 13, 12:51 pm, John K Masters <johnmast...@oxtedonline.net>
wrote:
> Can someone point me in the direction of a good tutorial on programming
> python with a GUI?


Alan Gauld added a gui programming tutorial to his main course.

http://www.freenetpages.co.uk/hp/alan.gauld/

It's a frame page so I can't link directly, but select "GUI
Programming" under Advanced Topics on the left.

rd

 
Reply With Quote
 
David Boddie
Guest
Posts: n/a
 
      05-14-2007
On May 14, 2:57 am, BartlebyScrivener <bscrivene...@gmail.com> wrote:
> On May 13, 12:51 pm, John K Masters <johnmast...@oxtedonline.net>
> wrote:
>
> > Can someone point me in the direction of a good tutorial on programming
> > python with a GUI?

>
> Alan Gauld added a gui programming tutorial to his main course.
>
> http://www.freenetpages.co.uk/hp/alan.gauld/
>
> It's a frame page so I can't link directly, but select "GUI
> Programming" under Advanced Topics on the left.


It may be worth pointing out that the information about licensing on
that page
is a little vague and inaccurate in places. PyGTK is actually licensed
under
the GNU LGPL, not the GPL, and both PyQt and PyGTK can be used to
create
commercial applications as long as those applications are not closed
source.

David

 
Reply With Quote
 
Jarek Zgoda
Guest
Posts: n/a
 
      05-14-2007
BartlebyScrivener napisał(a):

>> Can someone point me in the direction of a good tutorial on programming
>> python with a GUI?

>
> Alan Gauld added a gui programming tutorial to his main course.
>
> http://www.freenetpages.co.uk/hp/alan.gauld/
>
> It's a frame page so I can't link directly, but select "GUI
> Programming" under Advanced Topics on the left.


wxPython section of this tutorial seems bit outdated (the code resembles
what was required in time of wxPython 2.4). Anyway, the explanation of
event-driven approach is essential.

--
Jarek Zgoda

"We read Knuth so you don't have to."
 
Reply With Quote
 
Jarek Zgoda
Guest
Posts: n/a
 
      05-14-2007
John K Masters napisał(a):

> Can someone point me in the direction of a good tutorial on programming
> python with a GUI? I'm just starting out with python and have written a
> few scripts successfully but would like to add a graphical front end to
> them to make it easier for my work colleagues, most of whom have never
> used a command line, to use.


Each of GUI frameworks/libraries has its own tutorial and some even more
than one... The choice is directly related to what library you would use.

--
Jarek Zgoda

"We read Knuth so you don't have to."
 
Reply With Quote
 
John K Masters
Guest
Posts: n/a
 
      05-14-2007
On 15:03 Mon 14 May , Jarek Zgoda wrote:
> John K Masters napisaƂ(a):
>
> > Can someone point me in the direction of a good tutorial on programming
> > python with a GUI? I'm just starting out with python and have written a
> > few scripts successfully but would like to add a graphical front end to
> > them to make it easier for my work colleagues, most of whom have never
> > used a command line, to use.

>
> Each of GUI frameworks/libraries has its own tutorial and some even more
> than one... The choice is directly related to what library you would use.


Thanks to all for the advice. I shall start with Py-GTK and see how it
goes.

Regards, John
--
War is God's way of teaching Americans geography
Ambrose Bierce (1842 - 1914)
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Do programmers enjoy video tutorial or written tutorial ? Linuxmank Java 36 08-08-2009 09:54 AM
Tutorial or Example (or Tutorial) of Using Canvas to Produce a Plot W. Watson Python 13 09-20-2007 04:29 PM
Suggestion requested: Tutorial on Ajax reusable Java GUI Classes chiluvuri1@yahoo.com Java 0 05-13-2006 04:25 AM
Tutorial for beginner/ Tutorial voor beginner Rensjuh C++ 7 09-02-2004 12:41 AM
Tutorial for DB-Frontend with GUI Al Bogner Python 2 11-15-2003 02:50 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57