Created
September 26, 2017 15:59
-
-
Save meau/cd15fcaf1371e8f0488308ad92017fa6 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 shutil, os | |
with open('files.txt', 'r') as images: | |
myImages = {line.strip() for line in images} | |
print myImages | |
dir_src = r"/Volumes/nas/SSC-CAImages/ArchivalTIFF" | |
dir_dst = r"/Users/mcallahan/Desktop/PPImages" | |
for dirpath, dirs, files in os.walk(dir_src): | |
for file in files: | |
bn,ext = os.path.splitext(file) | |
if ext == ".tif" and any(s in file for s in myImages): | |
shutil.copy( os.path.join(dirpath, file), dir_dst ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment