Session One: Pythonic Math sa: 8144

So this was the first of four sessions, each 3.5 hours long. This is the curriculum module for "algebra only" kids I summarize in my CP4E slides for Vilnius: MVC paradigm, using string.Template, with two maybe three Views out the back (Python the Controller, standard vector math for the Model): POV-Ray and VPython, with X3D if we have time. Since I'd just returned from Vilnius, I spent some time briefing 'em on the conference itself, with Saturday Academy's blessings and encouragement. That meant showing Flickr slides of the venue, as well as my CP4E talk itself, with much of the time on the __rib__ syntax slides, as we'd already started our Tk-based Python shell session as follows (after the intial history lecture): (1) first ** for exponentiation, explaining how ^ is what many languages use (kudos to the student who guessed we'd use ^ -- I constantly poll the class with questions, elicit lots of participation). Then: 2**100000. Not every calculator can do that! (2) then, after a little dinking with "Python the calculator on steroids", we go:
dir(__builtins__) # car engine, but how does it work, what does it do?
[discussion]
dir(1) # any integer -- it's the *type* that matters
[more discussion]
dir('cat') # str type dir([]) # getting in to more data structures dir({}) # one of the most important ones
Pause for them just to play around in discovery learning mode, with lists and dictionaries, while I struggled to solve the projector puzzle (it's another new room, lots of good equipment, but no remote for the ceiling mounted projector -- solution: stand on a chair). Now, with Ubuntu running (Beryl for session manager -- a student clued me how to boot Beryl, after the boot process decided not to, given feedback from the projector (the one other Ubuntu user in the room, far as I could discern)). I then reviewed: (a) interactively reconfiguring IDLE (we'd done alittle already, converting to shell mode boot up vs. the text editor default set by the Vpython installer), (b) then played and projected in earnest re those data structures, talking most especially about lists today, as in mylist.append, mylist.pop and indexing (zero-based). Then, in response to a student question, I did a somewhat detailed account of: (c) import random and using randint as an example of what's going to be central in Python: importing, from the Standard Library, from 3rd parties with different release cycles. More on lists and dictionaries tomorrow, and probably every day (I talked a lot about the difference between recall and recognition learning, which they well understood). Finally, after all this hard work, it was time to reiterate the overall structure of the class (MVC with various Views), then kick back to watch 'Code Guardian' (about 10 minutes?) by Marco Spitoni (c) 2007. We'll do 'Warriors of the Net' tomorrow. One point of showing 'Code Guardian' is it's an example of render-time movie making, versus runtime game making (the latter a big focus at Europython I discovered, somewhat to my surprise -- Argentina stands out in this regard). RenderTime versus RunTime is a big theme of this course. See Aug 2006 SciAm for more on their possible future convergence (with RPUs instead of just GPUs for hardware). I had them test boot POV-Ray in anticipation of tomorrow, close everything, logout. Class dismissed! Looks like we're ready to roll. More tomorrow then. Kirby
participants (1)
-
kirby urner