According to the documentation, os.walk
returns a tuple with root, dirs and files in a given path. When I call os.walk
I get the following:
>>> import os
>>> os.listdir('.')
['Makefile', 'Pipfile', 'setup.py', '.gitignore', 'README.rst', '.git', 'Pipfile.lock', '.idea', 'src']
>>> root, dir, files = os.walk('src')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ValueError: too many values to unpack (expected 3)
>>> print (os.walk('src')) generator object walk at 0x10b4ca0f8>
I just don't understand what I'm doing wrong.