import os # Import the OS module
arr = []
if not os.path.exists('testdir'): # Check to see if it exists
os.makedirs('testdir') # Create the directory
print ('1000')
else:
for path, d, filelist in os.walk("testdir"):
for filename in filelist:
print (os.path.join(path, filename))
def scanfile(path,arr):
filelist = os.listdir(path)
allfile = []
for filename in filelist:
filepath = os.path.join(path,filename)
if os.path.isdir(filepath):
scanfile(filepath)
# print (filepath)
arr.append(filepath)
allfile = scanfile('testdir',arr)
for file in arr:
print("current filepath is : %s"%(file))