Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import os, shutil
- path_1 = "C:\\Users\\Deba\\wtf1"
- path_2 = "C:\\Users\\Deba\\wtf2"
- new_path_1 = "C:\\Users\\Deba\\p1"
- new_path_2 = "C:\\Users\\Deba\\p2"
- for path, subdirs, files in os.walk(path_1):
- for name in files:
- shutil.copy2(os.path.join(path, name), os.path.join(new_path_1, name))
- for path, subdirs, files in os.walk(path_2):
- for name in files:
- shutil.copy2(os.path.join(path, name), os.path.join(new_path_2, name))
- for path, subdirs, files in os.walk(new_path_1):
- for name in files:
- if not os.path.isfile(os.path.join(new_path_2, name)) or \
- os.path.getsize(os.path.join(new_path_2, name)) != os.path.getsize(os.path.join(new_path_1, name)):
- print("Pliku " + name + " nie ma w drugim folderze lub jego rozmiar sie nie zgadza")
Advertisement
Add Comment
Please, Sign In to add comment