Wadda ya mean it's not defined? Impossible Error?
Adonis
deltapigz at telocity.com
Mon Jun 4 20:33:23 EDT 2001
just initialize paths; like in C/C++ (in idea)
def parseLogs(paths = '', custs): # should initialize path to NULL
and your error should go away...
im new to Python; but ive encountered this a few times.
hope this helps.
Adonis
David Gilbert wrote:
> I'm getting what appears to be an impossible error. Here's a code
> snippet:
>
> def parseLogs(paths, custs):
>
> ipfRecord = re.compile("^([0-9]+)[ ]+([0-9]+)[
> ]+([0-9a-z]+)([+-])")
>
> last = {}
> for i in range(len(paths)): # Create start times
> ... and so on.
>
> Here's the error snippet:
>
> File "../devel/ditty/bandsaw2.py", line 37, in parseLogs
> for i in range(len(paths)): # Create start times
> UnboundLocalError: local variable 'paths' referenced before assignment
>
> Just when should "paths" be assigned?
>
> Dave.
More information about the Python-list
mailing list