[Edu-sig] Python for homeschoolers
Kirby Urner
urnerk at qwest.net
Fri Oct 10 18:22:52 EDT 2003
My Python + Geometry class for Python homeschoolers is going OK.
I'm at a ramshackle warehouse full of used computers being reassembled into
"freekboxes" by volunteers (who get a freekbox for their services).
The classroom consists of diskless workstations slaved to a server, usually
to 'obsidian' (the server name) a debian stable, but alternatively to
'raka', a debian unstable. raka hosts includes Python2.3 as well as Povray
3.5 (yay!).
I've learned that you need to start idle in an xterm with the -n switch if
you want multiple users to share it (I have about 8 users).
This was my second 1.5 hour class today.
Last week focused on range() -- range(a), range(a,b), range(a,b,c) options
-- and then we used the list output of that built-in to start investigating
lists (indexing, slicing).
Then we talked about the Pythagorean Theorem and Pythagorean triples, as up
ahead we want to look at a program for generating said triples. This will
require developing gcd(), because similar triangles don't count.
Today we moved on the strings, tuples and dictionaries, using dir() and
help() to get some clues about what these objects might do.
I delivered this talk on objects, with methods and attributes, focusing on
mydog.mood and mydog.bark() etc. Went back to lists to play with
mylist.sort() and mylist.reverse() -- as examples of object.method() syntax
in action.
But the class started with hands-on play using StrangeAttractors (not yet on
the market) and then looking at a PNG graphics file showing this very toy,
generated from Povray.
We pulled of the pov file and talked about the cylinder() command, the role
of <x,y,z> coordinates.
Other geometry was 'poly-gon' versus 'poly-hedron' (knees vs. faces for
those of you into etymologies).
These are middle-school aged kids, mostly boys, but one girl, and one middle
aged woman (the mom of one of the boys).
Getting the files uploaded took a fair amount of prep time. I'm shelling in
using OpenSSH on cygwin (mostly), leapfrogging from one server to another
within FreeGeek. sftp is cumbersome to use, and the connection gets dropped
for no apparent reason.
In sum (topics so far):
range()
naming objects e.g. mylist = range(10,0,-1)
the list object
triangles (as objects)
Pythagorean Theorem (special attributes of right triangles)
data structures: lists, dictionaries, tuples, strings
object.attribute and object.method() syntax (mydog.bark(3))
coordinate geometry -- (x,y,z) tuples as named points in a dictionary
polygons/polyhedra -- tuples of named points, pairs of point names as edges
Platonic Polyhedra
buckminsterfullerene (truncated icosahedron) and the allotropes of carbon
Kirby
More information about the Edu-sig
mailing list