python copy with pattern

import glob, os, shutil

files = glob.iglob(os.path.join(source_dir, "*.ext"))
for file in files:
if os.path.isfile(file):
shutil.copy2(file, dest_dir)

Leave a Reply

Your email address will not be published. Required fields are marked *