Teaching GUI's in Python?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

Teaching GUI's in Python?

Brian Wilkinson

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?

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

 

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
[hidden email]
http://mail.python.org/mailman/listinfo/edu-sig
Reply | Threaded
Open this post in threaded view
|

Re: Teaching GUI's in Python?

Vern Ceder-3
Hi Brian,

On Wed, Nov 9, 2011 at 10:58 AM, Brian Wilkinson <[hidden email]> 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.


Great news! Every programming course (especially Python programming course) in high school is win!
 

So finally to the questions:

 

1) Is teaching basic graphics too ambitious for an introductory course?


Not at all.
 

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


While there are many other tools, they all have the drawback of requiring extra installation, etc. That may be okay for school machines, but it can then be a bit of hassle for some kids if they want to install the same environment at home. So personally, I always tried to keep things as simple as possible. So my suggestion for an intro class would be to use the turtle library - it can do a ton of things, even to the point of creating reasonably fun games. Once you outgrow the turtle library, I'd suggest the next step is PyGame...

Good luck!! and keep us posted!

JMHO,

Vern
 

 

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
[hidden email]
http://mail.python.org/mailman/listinfo/edu-sig




--
Vern Ceder
[hidden email], [hidden email]
The Quick Python Book, 2nd Ed - http://bit.ly/bRsWDW



_______________________________________________
Edu-sig mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/edu-sig
Reply | Threaded
Open this post in threaded view
|

Re: Teaching GUI's in Python?

Sarina Canelake-2
In reply to this post by Brian Wilkinson
Hi Brian,

I think both approaches (with or without graphics) are popular. I'm a grad student and TA many different introductory courses, and I prefer teaching Object-Oriented Programming (OOP) with a graphics package.

You can see what I use at the OCW site for one of my classes, 6.189 - http://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-189-a-gentle-introduction-to-programming-using-python-january-iap-2011/ - you're welcome to use any of the material there, and I will provide solution files upon request. Homework 4, as well as projects 2 & 3, utilize a very simplified graphics package based off of TK. I use this package because I teach this course in 3 weeks and don't want to delve into tk stuff whatsoever; the point of using graphics, for us, is to introduce OOP in a more concrete way. It's easy to grasp what an object is when you're dealing with physical circles, squares, etc. However in a semester- or year- long course I think it would be wonderful to introduce some form of real graphics package; you're not going to go wrong teaching any of them, imho. I'm a fan of tk, but that's simply because it's what our lab and courses here use.

From a students' perspective, when I was learning programming, the graphical projects I did to learn Java (my third language) are far more memorable than the mathematical/from-a-textbook psets for my first languages (python and perl). I was so excited to show my Java projects to my parents (when we do the Tetris project in 6.189, the most-asked question is "how can I explain how to install Python to my parents, so I can email my project to them?")

Many of my students have gone on to do extra projects with PyGame and have loved that, as well.

Good luck! 
Sarina

On Wed, Nov 9, 2011 at 11:58 AM, Brian Wilkinson <[hidden email]> 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?

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

 

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
[hidden email]
http://mail.python.org/mailman/listinfo/edu-sig




--
Sarina Canelake
MIT EECS


_______________________________________________
Edu-sig mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/edu-sig
Reply | Threaded
Open this post in threaded view
|

Re: Teaching GUI's in Python?

Charles Cossé
In reply to this post by Brian Wilkinson
Hello Brian,
I agree with Vern Ceder thay pygame is the best for your purposes (probably turtle, too, but personally don't know about that).  Also, though, thought I'd suggest that you could throw-in some material to illustrate the syntactic similarities between python and javascript.   I do a lot of webapp development in javascript, and actually prototype in python all the time.  Once built, porting from py -> js is largely trivial.  I think this connection is often overlooked for whatever reason.  Good luck,
Charles Cosse

On Wed, Nov 9, 2011 at 9:58 AM, Brian Wilkinson <[hidden email]> 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?

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

 

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
[hidden email]
http://mail.python.org/mailman/listinfo/edu-sig




--
AsymptopiaSoftware|Software@theLimit
          http://www.asymptopia.org

_______________________________________________
Edu-sig mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/edu-sig
Reply | Threaded
Open this post in threaded view
|

Re: Teaching GUI's in Python?

Andrew Harrington
In reply to this post by Vern Ceder-3
You can do a lot of graphics with the turtle and no event handling.  A question is how much you want to get into event handling, vs just generating pictures and animations and allowing sequential interaction with the mouse.

Turtle graphics takes a"first-person" point of view.  Other simple graphics packages, also more aimed at a procedural flow:  
Zelle's package that I also use in my Hands-on Python Tutorial.  
Goldwasser and Lechter's a slightly fancier package cs1graphics.

On Wed, Nov 9, 2011 at 11:12 AM, Vern Ceder <[hidden email]> wrote:
Hi Brian,

On Wed, Nov 9, 2011 at 10:58 AM, Brian Wilkinson <[hidden email]> 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.


Great news! Every programming course (especially Python programming course) in high school is win!
 

So finally to the questions:

 

1) Is teaching basic graphics too ambitious for an introductory course?


Not at all.
 

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


While there are many other tools, they all have the drawback of requiring extra installation, etc. That may be okay for school machines, but it can then be a bit of hassle for some kids if they want to install the same environment at home. So personally, I always tried to keep things as simple as possible. So my suggestion for an intro class would be to use the turtle library - it can do a ton of things, even to the point of creating reasonably fun games. Once you outgrow the turtle library, I'd suggest the next step is PyGame...

Good luck!! and keep us posted!

JMHO,

Vern
 

 

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
[hidden email]
http://mail.python.org/mailman/listinfo/edu-sig




--
Vern Ceder
[hidden email], [hidden email]
The Quick Python Book, 2nd Ed - http://bit.ly/bRsWDW



_______________________________________________
Edu-sig mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/edu-sig




--
Dr. Andrew N. Harrington
  Computer Science Department 
  Loyola University Chicago
Lakeshore office in the Math Department: 205 Loyola Hall
http://www.cs.luc.edu/~anh
Phone: 773-915-7999
Fax:    312-915-7998
[hidden email]



_______________________________________________
Edu-sig mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/edu-sig
Reply | Threaded
Open this post in threaded view
|

Re: Teaching GUI's in Python?

Kirby Urner-6
In reply to this post by Brian Wilkinson
On Wed, Nov 9, 2011 at 8:58 AM, Brian Wilkinson
<[hidden email]> 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
> [hidden email]
> http://mail.python.org/mailman/listinfo/edu-sig
>
_______________________________________________
Edu-sig mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/edu-sig
Reply | Threaded
Open this post in threaded view
|

Re: Teaching GUI's in Python?

A. Jorge Garcia
In reply to this post by Vern Ceder-3
Vern Ceder <[hidden email]> wrote:
Hi Brian,

On Wed, Nov 9, 2011 at 10:58 AM, Brian Wilkinson <[hidden email]> 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.


Great news! Every programming course (especially Python programming course) in high school is win!
 

So finally to the questions:

 

1) Is teaching basic graphics too ambitious for an introductory course?


Not at all.
 

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


While there are many other tools, they all have the drawback of requiring extra installation, etc. That may be okay for school machines, but it can then be a bit of hassle for some kids if they want to install the same environment at home. So personally, I always tried to keep things as simple as possible. So my suggestion for an intro class would be to use the turtle library - it can do a ton of things, even to the point of creating reasonably fun games. Once you outgrow the turtle library, I'd suggest the next step is PyGame...

Good luck!! and keep us posted!

JMHO,

Vern
 

 

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
[hidden email]
http://mail.python.org/mailman/listinfo/edu-sig




--
Vern Ceder
[hidden email], [hidden email]
The Quick Python Book, 2nd Ed - http://bit.ly/bRsWDW



Sounds like good advice! Are there any curricular materials for introducing the turtle library that you can recommend?
Thanx,
A. Jorge Garcia
Applied Math and CompSci
http://shadowfaxrant.blogspot.com
http://www.youtube.com/calcpage2009
Sent via DROID on Verizon Wireless
_______________________________________________
Edu-sig mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/edu-sig
Reply | Threaded
Open this post in threaded view
|

Re: Teaching GUI's in Python?

Kirby Urner-6
In reply to this post by Kirby Urner-6
> Exhibit, old project:  http://pygeo.sourceforge.net/
>

Arthur Siegel was the creator of this and he and I used to take a lot
of the bandwidth here on edu-sig hashing it out about various topics.
I still go back to that stuff.  We have a great archive, lots of
spirited discussion.

Having read other responses, I agree JavaScript deserves front and
center treatment, however I'd make a distinction between the server
and client and talk realistically of Python on the server.

You can talk about Model View Controller in a kind of "cave painting"
setting, where you don't squander hours on any one framework.

In my geometry classes, I bury the specs for polyhedrons in a
relational database (sqlite3 is good) and pull them up in VPython.

Turtle Art is fantastic and we've had many brilliant postings on that
thread.  At OST, I've been pioneering "Tractor Art", far more
primitive (ASCII-based "graphics") -- you'll see some evidence of that
work in those screen shots (my last post).

Kirby
_______________________________________________
Edu-sig mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/edu-sig
Reply | Threaded
Open this post in threaded view
|

Re: Teaching GUI's in Python?

Andrew Harrington
Is anyone trying to modernize the code to work with more modern versions of the supporting packages?  Sad to still see Arthur's email address still on the home page so many years after his death.

Andy

On Wed, Nov 9, 2011 at 11:55 AM, Kirby Urner <[hidden email]> wrote:
> Exhibit, old project:  http://pygeo.sourceforge.net/
>

Arthur Siegel was the creator of this and he and I used to take a lot
of the bandwidth here on edu-sig hashing it out about various topics.
I still go back to that stuff.  We have a great archive, lots of
spirited discussion.

Having read other responses, I agree JavaScript deserves front and
center treatment, however I'd make a distinction between the server
and client and talk realistically of Python on the server.

You can talk about Model View Controller in a kind of "cave painting"
setting, where you don't squander hours on any one framework.

In my geometry classes, I bury the specs for polyhedrons in a
relational database (sqlite3 is good) and pull them up in VPython.

Turtle Art is fantastic and we've had many brilliant postings on that
thread.  At OST, I've been pioneering "Tractor Art", far more
primitive (ASCII-based "graphics") -- you'll see some evidence of that
work in those screen shots (my last post).

Kirby
_______________________________________________
Edu-sig mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/edu-sig



--
Dr. Andrew N. Harrington
  Computer Science Department 
  Loyola University Chicago
Lakeshore office in the Math Department: 205 Loyola Hall
http://www.cs.luc.edu/~anh
Phone: 773-915-7999
Fax:    312-915-7998
[hidden email]



_______________________________________________
Edu-sig mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/edu-sig
Reply | Threaded
Open this post in threaded view
|

Re: Teaching GUI's in Python?

kirby urner-4
On Wed, Nov 9, 2011 at 11:59 AM, Andrew Harrington <[hidden email]> wrote:
> Is anyone trying to modernize the code to work with more modern versions of
> the supporting packages?  Sad to still see Arthur's email address still on
> the home page so many years after his death.
>

I've seen estates keep email and Facebook pages alive for ancestors.
My work for the Oversight Committee of my local Meeting (religious)
has been to get those questions added to our "Wishes Upon Death" form
(i.e. what shall we do with your Flickr Photostream?  Most would want
theirs kept alive I expect).

"Deceased" needs to be just one more status on Facebook, akin to "in a
relationship".

As for Arthur's code, I think it's a time capsule for a future time
when the set of those into projective geometry (ala Klein), and the
set of those into Python (ala us), is not so close to the null set.

The way the Venn Diagrams look today, it appears some trend towards
hyper-specialization brought us close to the brink.   Good thing we've
reversed that trend, and not a moment too soon.

Kirby
_______________________________________________
Edu-sig mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/edu-sig