Outline for February 24, 2012
Reading:
§19
Breaking out of loops
continue
break
Handling exceptions [
except.py
]
except error
except error as msgvar
finally
[
turtlenx.py
]
Common exceptions
ZeroDivisionError
TypeError
SyntaxError
NameError
IOError
EOFError
SystemError
raise
Directories and the file system
Path names and file names
os.path.isfile(fname)
,
os.path.isdir(dname)
os.remove(fname)
os.path.split(path)
,
os.path.basename(path)
,
os.path.dirname(path)
,
os.path.splitdrive
(path)
os.path.abspath(relpath)
A PDF version is available here.
ECS 10, Basic Concepts of Computing
Winter Quarter 2012