Advertisement
Guest User

Untitled

a guest
Feb 28th, 2020
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. import os
  2. import shutil
  3. def find (name, path):
  4. results = []
  5. for root, dirs, files in os.walk(path):
  6. for x in files:
  7. if path.endswith(name + '.rar'):
  8. results.append(os.path.join(root, name))
  9. print('yes')
  10. shutil.move(name, 'testfolder')
  11. else:
  12. print('no')
  13. return os.path.join(root, name)
  14. find(name = 'abc12', path = '/home/malachi/Desktop/projects/modorg')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement