Advertisement
Guest User

Script

a guest
Jan 20th, 2019
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. import shutil
  2. import os
  3.  
  4. source = "C:/Users/dariu/AppData/Local/Packages/Microsoft.Windows.ContentDeliveryManager_cw5n1h2txyewy/LocalState/Assets/"
  5. destination = "D:/Desktop/Spotlight/New"
  6.  
  7. files = os.listdir(source)
  8.  
  9.  
  10. def main():
  11. copy()
  12. rename()
  13.  
  14.  
  15. def copy():
  16. for f in files:
  17. shutil.copy(source + f, destination)
  18. os.rename(f, f.replace)
  19.  
  20.  
  21. def rename():
  22. i = 1
  23. for f in files:
  24. os.rename(f, 'Spotlight_', + str(i), '.jpg')
  25.  
  26.  
  27. if __name__ == '__main__':
  28. main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement