Created
January 3, 2014 09:21
-
-
Save sfszh/8235190 to your computer and use it in GitHub Desktop.
print all files including directories
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
def Test2(rootDir, filehandle): | |
for lists in os.listdir(rootDir): | |
path = os.path.join(rootDir, lists) | |
print path | |
filehandle.write(path + '\n') | |
if os.path.isdir(path): | |
Test2(path,filehandle) | |
if __name__ == '__main__': | |
filehandle = open('luaFileList.txt','w') | |
Test2('.',filehandle) | |
filehandle.close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment