By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,235 Members | 1,057 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,235 IT Pros & Developers. It's quick & easy.

GUI tutorial

P: n/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.

Regards, John
--
War is God's way of teaching Americans geography
Ambrose Bierce (1842 - 1914)
May 13 '07 #1
Share this Question
Share on Google+
8 Replies


P: n/a
John K Masters <jo*********@oxtedonline.netwrites:
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.
May 13 '07 #2

P: n/a
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
May 13 '07 #3

P: n/a
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-----

May 13 '07 #4

P: n/a
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

May 14 '07 #5

P: n/a
On May 14, 2:57 am, BartlebyScrivener <bscrivene...@gmail.comwrote:
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

May 14 '07 #6

P: n/a
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."
May 14 '07 #7

P: n/a
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."
May 14 '07 #8

P: n/a
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)
May 14 '07 #9

This discussion thread is closed

Replies have been disabled for this discussion.