Guest User

Untitled

a guest
Jul 12th, 2015
205
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.80 KB | None | 0 0
  1. import os, shutil
  2.  
  3. path_1 = "C:\\Users\\Deba\\wtf1"
  4. path_2 = "C:\\Users\\Deba\\wtf2"
  5. new_path_1 = "C:\\Users\\Deba\\p1"
  6. new_path_2 = "C:\\Users\\Deba\\p2"
  7.  
  8. for path, subdirs, files in os.walk(path_1):
  9.     for name in files:
  10.         shutil.copy2(os.path.join(path, name), os.path.join(new_path_1, name))
  11.  
  12. for path, subdirs, files in os.walk(path_2):
  13.     for name in files:
  14.         shutil.copy2(os.path.join(path, name), os.path.join(new_path_2, name))
  15.  
  16. for path, subdirs, files in os.walk(new_path_1):
  17.     for name in files:
  18.         if not os.path.isfile(os.path.join(new_path_2, name)) or \
  19.                 os.path.getsize(os.path.join(new_path_2, name)) != os.path.getsize(os.path.join(new_path_1, name)):
  20.             print("Pliku " + name + " nie ma w drugim folderze lub jego rozmiar sie nie zgadza")
Advertisement
Add Comment
Please, Sign In to add comment