Advertisement
Guest User

Untitled

a guest
Jun 22nd, 2018
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.33 KB | None | 0 0
  1. import flask
  2. import sqlite3
  3.  
  4.  
  5. app = flask.Flask(__name__)
  6.  
  7. @app.route("/")
  8. def index():
  9.   db = sqlite3.connect("/tmp/my.db")
  10.   cursor = db.cursor()
  11.   cursor.execute("SELECT id, name, bday from ctfers;")
  12.   result = cursor.fetchall()
  13.   cursor.close()
  14.   db.close()
  15.   return str(result)
  16.  
  17. app.run(host="0.0.0.0", port=8081)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement