python loop through subdirectories


Probably one of the weirdest python code i have ever seen to loop through files in a directory. But i think its pretty efficient.


for subdir, dirs, files in os.walk("."):
    for file in files:
        print os.path.join(subdir, file)


-Yay! prints all the files in a directory.

Comments

Popular posts from this blog

The specified initialization vector (IV) does not match the block size for this algorithm