Skip to content

Instantly share code, notes, and snippets.

@xcodebuild
Created July 28, 2015 07:21
Show Gist options
  • Save xcodebuild/72f4ad1d2387265f63df to your computer and use it in GitHub Desktop.
Save xcodebuild/72f4ad1d2387265f63df to your computer and use it in GitHub Desktop.
flask_watch_file.py
extra_dirs = ['./']
extra_files = extra_dirs[:]
for extra_dir in extra_dirs:
for dirname, dirs, files in os.walk(extra_dir):
for filename in files:
filename = os.path.join(dirname, filename)
if os.path.isfile(filename) and os.path.splitext(filename)[1] in ['.py', '.html', '.js']:
extra_files.append(filename)
if __name__ == '__main__':
app.run(debug=True,extra_files=extra_files)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment