[Edu-sig] Teaching GUI's in Python?

Kirby Urner kurner at oreillyschool.com
Wed Nov 9 18:46:17 CET 2011


On Wed, Nov 9, 2011 at 8:58 AM, Brian Wilkinson
<Brian.Wilkinson at ssfs.org> wrote:
>
> Hello everyone,
>
>
>
> Our upper school, looking to beef up their technology offerings, offered an introductory programming course this year using Python.  I am normally a technology coordinator, supporting teachers and students, but was tapped to teach this class (which I have thoroughly enjoyed so far).  The purpose of this course is to try and get kids excited about programming and so I would like to teach them a bit about graphics and GUI’s.  My initial thought was just to have them work with tkinter, as that (to me) seems the easiest path.  After doing some reading, it looks as though wxPython and pyQt are popular options as well.
>
>
>
> So finally to the questions:
>
>
>
> 1) Is teaching basic graphics too ambitious for an introductory course?

Hi Brian --

I'm writing from my work address because this is particularly apropos,
around the water cooler conversation.

We teach GUI programming with Tkinter, and that's a perfectly good way
to go just to get the concepts.

With intro, you want to talk about everything, including wxPython (hi
Robin, Kevin...) and PyQT (don't know them, know it's pretty and has
lots more SQL stuff than Tk).

You can demo, yak, visit websites, show samples of code, without
making the homework be that.

Exhibits of old projects, like on a tour:

http://pythoncard.sourceforge.net/  (topics like SourceForge, Github,
version control, community coding -- you can yak about, as a tour
guide, without requiring hours of sweat learning git or hg).

Your other chief contender I'd say is the browser itself, if you want
to dive down the HTML5 route (hot right now), with Python busily
scribbling stuff on the server, return an httpresponse (even Standard
Library can do that).

>
> 2) If the answer to #1 is no, do folks out there have suggestions for the best tool to use with the students?

My answer was yes.

I also think Visual Python (VPython) is highly useful for the kind of
geometry I'm doing / teaching / learning.

Exhibit, old project:  http://pygeo.sourceforge.net/

My approach in some classrooms (e.g. saturdayacademy.org) has been not
to teach Python as computer programming but as a math notation, so
getting math cred.

Never heard of computer science, don't know what that means (exaggerating).

Back to Tk, the GUI programs we have them write are by Steve Holden,
current PSF chairman.  They're pretty simple, like just "give us some
buttons along the bottom in some frames, and blah blah" (more definite
than that).

You build towards having an email application, sitting atop and SQL
engine, so it's not un-integrated with other topics we cover (a TDD
focus -- good stuff, pretty challenging).

However, we at the O'Reilly School of Technology (of O'Reilly Media)
don't do Tk / GUI stuff in the first course, Beginning Python, which
is the true intro course.

So in a sense, we aren't using it with beginners, because the Python 2
course assumes you're already at the Python 1 level of fluency (there
are four in the sequence).

It's a little hard to equate our situations, because my students are
on their own schedule and don't report to class.

They just have to get their GUIs right to continue up the fish ladder.
 The majority of programs are not GUI.  We get into optparse and argv
a lot, and of course user input( ).

Here's my stash of screen shots to give the flavor (I'll link to a
student GUI attempt -- we use Eclipse for our IDE):

http://www.flickr.com/photos/17157315@N00/5717612982/in/set-72157625646071793

(this is something I might send back for a next draft, because the
text widget should completely fill the frame and scale with it, and
the buttons should be thin across the bottom without the fat layer).

Kirby

>
>
>
> I have enjoyed reading this group this year.  It has been a big help.
>
>
>
> Brian Wilkinson
>
> Sandy Spring Friends School
>
> Technology Resource Coordinator
>
>
>
> “When you have eliminated the impossible, whatever remains, however improbable, must be the truth.”
>
>
>
> _______________________________________________
> Edu-sig mailing list
> Edu-sig at python.org
> http://mail.python.org/mailman/listinfo/edu-sig
>


More information about the Edu-sig mailing list