fork download
  1. #! /usr/bin/env python3.6
  2.  
  3. from flask import Flask, render_template
  4.  
  5. app = Flask(__name__)
  6.  
  7. @app.route('/')
  8. @app.route('/index')
  9. def index():
  10. items = list(reversed(range(1,10)))
  11. def insertion_sort(items):
  12. for i in range(1, len(items)):
  13. j = i
  14. while j > 0 and (items[j] < items[j-1]):
  15. items[j], items[j-1] = items[j-1], items[j]
  16. j -= 1
  17. yield items
  18.  
  19. return render_template("index.html", items=insertion_sort(items))
  20.  
  21.  
  22. if __name__ == '__main__':
  23. app.run()
Runtime error #stdin #stdout #stderr 0.04s 9328KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
Traceback (most recent call last):
  File "./prog.py", line 3, in <module>
ImportError: No module named 'flask'