Exception handling style
Bad:
try:
parse_args()
f = open(file)
read_input()
make_report()
except IOError:
print file, "not found"
# (what if read_input()
# raises IOError?)
Good:
parse_args()
try:
f = open(file)
except IOError, msg:
print file, msg
sys.exit(1)
read_input()
make_report()