Created
December 6, 2021 20:51
-
-
Save jack-champagne/8c48fd2341e59286b647b01000e36332 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import shutil | |
import time | |
source = "C:\\Users\\juliu\\OneDrive\\Pictures\\Screenshots\\" | |
dest = "C:\\Users\\juliu\\Picture\\iCloud Photos\\Photos" | |
source_list = [] | |
os.chdir(os.path(source)) | |
files = [f for f in os.listdir('.') if os.path.isfile(f)] | |
source_list = files | |
while True: | |
files = [f for f in os.listdir('.') if os.path.isfile(f)] | |
if (files != source_list): | |
files_to_copy = [f for f in os.listdir('.') if os.path.isfile(f) and f not in source_list] | |
source_list = files | |
for file in files_to_copy: | |
shutil.copy(source + file, dest + file) | |
time.sleep(15) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment