python copy files and folders recursive


import errno
import shutil

def copy(src, dest):
try:
shutil.copytree(src, dest)
except OSError as e:
if e.errno == errno.ENOTDIR:
shutil.copy(src, dst)
else:
print('Directory not copied. Error: %s' % e)

Leave a Reply

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