import ospath = "/books/python"def printFiles(dirList, spaceCount): for file in dirList: print "/".rjust(spaceCount+1) + filedef printDirectory(dirEntry): print dirEntry[0] + "/" printFiles(dirEntry[2], len(dirEntry[0]))tree = os.walk(path)for directory in tree: printDirectory(directory)
Name (required)
email (will not be published) (required)
Website