[Tutor] anecdote in the workplace about try,except clause

alan.gauld@bt.com alan.gauld@bt.com
Sat, 18 Aug 2001 21:59:04 +0100


Since we have established that data doesn't go out of scope...

> > > for line in file:
> > >     try:
> > >         data, garbage = string.split(line, ':')
> > >     except ValueError:
              data = line

should fix it, no?

The comment about data going out of scope confused me but 
now that thats been cleared up the simple fix above should 
work (my trivial tests so far suggest it does...)

Alan g