Skip to content

Instantly share code, notes, and snippets.

@sfszh
Created January 3, 2014 09:21
Show Gist options
  • Save sfszh/8235190 to your computer and use it in GitHub Desktop.
Save sfszh/8235190 to your computer and use it in GitHub Desktop.
print all files including directories
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