Those are some good responses, but I think they focused a little too
much on the specifics of my example - especially the 'print'
statement. In real life, I want to set some return values to sensible
defaults if the file doesn't exist, but I want the errors from inside
the block to trickle up as no
I have:
try:
for line in open(myFileName):
count += 1
except IOError:
print "Can't open myfile"
(I know, this is bad, I never close the file, but its just for
illustration). But then I change it to:
try:
for line in open(myFileName):
count += openAndProcessSubfile(lin