Aug-14-2018, 12:51 PM
(This post was last modified: Aug-14-2018, 12:52 PM by Gribouillis.)
According to the documentation, os.walk generates 3-tuples
(dirpath, dirnames, filenames)
, so you need to writefor root, dirs, files in os.walk(rootdir): ...root is a directory, dirs is a list of names of subdirectories and files is a list of names of subfiles. With your present code, dirs is a 3-tuple.