import shutil
def copyDirectory(src, dest):
if os.path.exists(PF):
shutil.rmtree(PF)
try:
shutil.copytree(src, dest)
# Directories are the same
except shutil.Error as e:
print('Directory not copied. Error: %s' % e)
# Any error saying that the directory doesn't exist
except OSError as e:
print('Directory not copied. Error: %s' % e)
!rm .DS_store
print(os.path.exists('.DS_Store')) # delete the generated hidden file