Skip to content

Instantly share code, notes, and snippets.

@jack-champagne
Created December 6, 2021 20:51
Show Gist options
  • Save jack-champagne/8c48fd2341e59286b647b01000e36332 to your computer and use it in GitHub Desktop.
Save jack-champagne/8c48fd2341e59286b647b01000e36332 to your computer and use it in GitHub Desktop.
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