I am studying the os.walk() method.
All the examples I've been able to find show the usage as:
for root, dirs, files in os.walk(trackeddir):
for name in files:
print(os.path.join(root, name))
for name in dirs:
print(os.path.join(root, name))
...
However, when I try: root, dirs, files = os.walk(trackeddir)
, I get an exception: "too many values to unpack (expected 3)"
I tried putting the output of os.walk() into a variable and seeing what is stored in that variable, during debug, but I was unable to see any "root", "files" or "dirs" I expected to see a tuple but, instead, I see an instance of 'generator'
I am a relatively "OK" Java developer and this new style of handling data in runtime is really confusing. Any help in trying to wrap my head around it will be hugely appreciated!