#http://pythoncentral.io/how-to-traverse-a-directory-tree-in-python-guide-to-os-walk/
#https://www.programcreek.com/python/example/60/os.walk
import os
print os.name
print(os.getcwd())
path="/Users/muthuselvan/Development/codeGym"
print "Is directory " , os.path.isdir(path)
for files in os.listdir(path):
    print "Files " , files
    if os.path.isdir(path):
        print os.path.dirname(path)


# def printfilesindirector(path):
    # for files in os.listdir(path):


def traverseDirectory(rootDirectory):
    print "Traversing : " , rootDirectory
    for dirname,sub_dir, filelist in os.walk(rootDirectory):
        print ("Found directory --> " , dirname)
        for fname in filelist:
            print "File name  -------> " , fname

if __name__ == '__main__':
    traverseDirectory("/Users/muthuselvan/Development/codeGym")


#def listFile(directory):
#    for listfile in os.listdir(directory):
