Skip to content

Instantly share code, notes, and snippets.

@mapsam
Created May 1, 2015 05:25
Show Gist options
  • Save mapsam/6862e2cfe768e5af3e8c to your computer and use it in GitHub Desktop.
Save mapsam/6862e2cfe768e5af3e8c to your computer and use it in GitHub Desktop.
copy directory in flask
import shutil
def copyDirectory(src, dest):
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)
copyDirectory('app/static/node_modules/bootstrap/dist/fonts', 'app/static/public/fonts/')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment