* Let's explore the stdlib and accomplish some common tasks

Chandler/Oregon
 - files/paths. Find the current directory and
   search for all .py files in any
   subdirectories. Explain glob.glob, os.getcwd,
   os.walk/os.path.walk, os.path.join...

            
   
Santa Clara/Folsom
 - Parse XML. Grab the CIA World Factbooks
   (it's in the newlabs.zip as mondial.xml) and build a list
   of the top 10 countries by GDP/capita. Explain
   xml.etree.ElementTree

e = ElementTree.fromstring(open("mondial.xml").read())
countries = e.findall("country")
l = [(c.find("name"), c.find("gdp_total")) for c in countries]
lst = [(getattr(a, 'text', ''), getattr(b, 'text', '')
           for a,b in l]
sorted(lst, key=lambda t:float(t[1]) if t[1] else 0,
        reverse=True)[:10]
           
   
 - shelling out. Run a shell command (ls or dir)
   and capture the output. Explain
   subprocess.call, subprocess.check_output,
   commands.getstatusoutput.

 - Use http. Retrieve the contents of
   http://simeonfranklin.com/python-fundamentals/. Optionally:
   Read the html and find all the links. Build a
   list of links which are 404's. Explain
   urllib.urlopen, (and optionally) HTMLParser.

 - Parse XML. Grab the CIA World Factbooks
   (it's in the newlabs.zip as mondial.xml) and build a list
   of the top 10 countries by GDP/capita. Explain
   xml.etree.ElementTree

 - (And much much more. Measure memory use. Get
   list of processes and send signals. Read/Write
   binary data and zipfiles. Take timing
   measurements. Talk formats (xml, json, csv,
   mime). Do date math, arbitrary precision math...
