Advertisement
Guest User

Untitled

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