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

OpenCover code coverage for .Net Core

Using Custom DLL with IronPython / Scripts

ionic2 cordova build android - Unable resolve gradle 2.2.3