Created
February 12, 2016 16:35
-
-
Save paxti/4b7d29bc2364130b1b9d to your computer and use it in GitHub Desktop.
Recursive search and copy
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 glob | |
from shutil import copyfile | |
import shutil | |
import os | |
i=0 | |
search_template = 'C:/**/*ert*.jpg' | |
copy_to = 'C:/Pintrest/' | |
for filename in glob.iglob(search_template, recursive=True): | |
print(filename) | |
shutil.copyfile(filename, copy_to + str(i) + '__' + os.path.basename(filename)) | |
i += 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment