Problems with os.walk

Dominique.Holzwarth at ch.delarue.com Dominique.Holzwarth at ch.delarue.com
Thu May 8 03:26:28 EDT 2008


Hi everyone

The following code:

scriptPath = os.path.dirname(__file__)
(dirpath, dirnames, filenames) = os.walk(scriptPath)
print 'dirpath\n'
print dirpath
print 'dirnames\n'
pprint.pprint(dirnames)
print 'filenames\n'
pprint.pprint(filnames)

Fails on the os.walk call with the following error:

    (dirpath, dirnames, filenames) = os.walk(scriptPath)
ValueError: need more than 1 value to unpack

Any ideas what could be wrong?

Thx & greetings
Dominique

*****************************************************************************
This e-mail and any files attached are strictly confidential, may be legally
privileged and are intended solely for the addressee. If you are not the
intended recipient please notify the sender immediately by return email and
then delete the e-mail and any attachments immediately.

The views and or opinions expressed in this e-mail are not necessarily the
views of De La Rue plc or any of its subsidiaries and the De La Rue Group
of companies, their directors, officers and employees make no representation
about and accept no liability for its accuracy or completeness.

You should ensure that you have adequate virus protection as the De La Rue
Group of companies do not accept liability for any viruses.

De La Rue plc Registered No.3834125, De La Rue Holdings plc Registered
No 58025 and De La Rue International Limited Registered No 720284 are all
registered in England with their registered office at:
De La Rue House, Jays Close, Viables, Hampshire RG22 4BS
*****************************************************************************




More information about the Python-list mailing list