Outline for February 24, 2012

Reading: §19

  1. Breaking out of loops
    1. continue
    2. break
  2. Handling exceptions [except.py]
    1. except error
    2. except error as msgvar
    3. finally [turtlenx.py]
    4. Common exceptions
      1. ZeroDivisionError
      2. TypeError
      3. SyntaxError
      4. NameError
      5. IOError
      6. EOFError
      7. SystemError
    5. raise
  3. Directories and the file system
    1. Path names and file names
    2. os.path.isfile(fname), os.path.isdir(dname)
    3. os.remove(fname)
    4. os.path.split(path), os.path.basename(path), os.path.dirname(path), os.path.splitdrive(path)
    5. os.path.abspath(relpath)

A PDF version is available here.
ECS 10, Basic Concepts of Computing
Winter Quarter 2012