[Edu-sig] outlining a Python course...

Kirby Urner urner at alumni.princeton.edu
Fri Mar 11 20:30:49 EST 2016


Last month I offered some admittedly simplistic heuristics
regarding how a boot camp / code school might use the
colored belt system of martial arts to signal progress to a
goal.

https://mail.python.org/pipermail/edu-sig/2016-February/011368.html

Applied to Python, the formula was simply one of "knowing all
the keywords" at the end of the day.  That translates to a good
reading knowledge of Python, with many adventures yet ahead.

"Black belt" just means you know enough to keep learning, not that
you're now some uber-guru.  The language itself doesn't stop you
i.e. you can read other peoples fluent code and keep growing as
a coder.

I've been experimenting with this motif with my ten session class
in California.  We might twice a week for four hours each time.

We do something like (this is a rough approximation):

===

Week One:  basic types / big picture (rolling your own):
REPL IDE IDLE distro python.org anaconda.org jupyter
core std library 3rd party = dir id is == < > import math tuple
list dict set datetime namedtuple True False int float str input
print __builtins__ __doc__ help pydoc __name__ __file__

===

Week Two:   flow of control / structure of a module docstring
comment class def lambda map filter return if while for break
continue self __getattr__ __getitem__ __call__ __add__ __mul__
__eq__ python -c -m .py .pyc bash

===

Week Three:  file i/o; more flow: open try except finally with
assert str.format printf (%) read readlines write seek tell 'b' 'wb' 'w'
unicode ascii  __str__ __repr__  __enter__ __exit__ sys os
os.path

===

Week Four:  globals locals global nonlocal *args **kwargs
decorator syntax: @property @classmethod @staticmethod
list set dict comprehensions, generator expressions

===

Week Five:  generator functions yield send itertools coroutine
yield from async event loops event driven programming GUI tools
sockets threading multiprocessing concurrency

===

Such a Python course is *not* equivalent to a "full stack
developer" or web dev course.  I'll have more to say on the
latter in a future posting.  This hypothetical week Six might
be a segue:

===

Week Six:  "full stack" sqlite3 http / https; SQL / noSQL
JavaScript HTML / CSS, web frameworks requests Flask
Django web2py template language

===

Notes:

I like bringing in collections.namedtuple and datetime.datetime
pretty early.  The former serves as a bridge from index access
e.g. Point[0] to attribute dot notation access e.g. Point.x whereas
the latter gives students more appreciation for how builtin types
may already contain lots of worldly knowledge.

Time has concrete meaning and is somewhat messy.  That's
a good thing. The shift to daylight savings time this weekend is
highly topical. :-D

For a lot of my special names I use a Permutation class and
talk about elementary group theory.  There's a simple cryptography
angle that keeps the narrative going and enough logic to make
the code interesting:

https://github.com/4dsolutions/Python5/blob/master/px_class.py

This curriculum is still evolving.  I'm always on the lookout for
good ideas (and on this listserv I get them aplenty).


Kirby
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/edu-sig/attachments/20160311/9c77dfff/attachment.html>


More information about the Edu-sig mailing list