import os,shutil
def getdirfiles(maindir,dstdir,filepaths):
filenames=os.listdir(maindir)
for filename in filenames:
filepath=os.path.join(maindir,filename)
if os.path.isdir(filepath):
getdirfiles(filepath,dstdir,filepaths)
elif os.path.isfile(filepath):
filepaths.append(filepath)
if __name__ == '__main__':
maindir=r'Project'
dstdir = r'temp'
filepaths=[]
getdirfiles(maindir, dstdir,filepaths)
print(filepaths)