os.walk Value Error?
gagsl-py2 at yahoo.com.ar
Mon Jun 16 08:20:32 CEST 2008
En Sat, 14 Jun 2008 19:06:16 -0300, <tdahsu at gmail.com> escribió:
> I'm using os.walk as follows:
> (basedir, pathnames, files) = os.walk("results", topdown=True)
> and I'm getting the error:
> ValueError: too many values to unpack
>> From my googling, that means:
> This is the standard message when Python tries to unpack a tuple
> into fewer variables than are in the tuple.
>> From what I can see of the examples on the python site, I'm using it
> correctly. I have commas in my original code, and the "results"
> directory exists and is directly under the directory from which my
> script is run.
Look the examples more carefully again - they don't use an assignment, but another Python statement...
More information about the Python-list