[Tutor] Does try-except "lock out scope" or similar?
benjamin.serrato at gmail.com
Tue Mar 8 05:40:24 CET 2011
I wrote a short script to clean up a csv file but had trouble when
date_time = time.strptime(date_string, "%m/%d/%y")
would choke on intermittent Null characters in the file. I put it into a
try-except, but then I found I couldn't do
because I receive a "row is not defined" complaint or similar. So, how do I
run time.strptime() without locking myself out. And, what is the pretty way
to do all of this, because a couple hours later it looks pretty ugly. I mean
it turns out I'm rewriting the file anyway so no need to delete the row.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Tutor