Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import flask
- import sqlite3
- app = flask.Flask(__name__)
- @app.route("/")
- def index():
- db = sqlite3.connect("/tmp/my.db")
- cursor = db.cursor()
- cursor.execute("SELECT id, name, bday from ctfers;")
- result = cursor.fetchall()
- cursor.close()
- db.close()
- return str(result)
- app.run(host="0.0.0.0", port=8081)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement