Skip to content

Instantly share code, notes, and snippets.

@plasx
Created December 14, 2016 01:58
Show Gist options
  • Save plasx/b4111e3a032714bb2721194a4fc2198b to your computer and use it in GitHub Desktop.
Save plasx/b4111e3a032714bb2721194a4fc2198b to your computer and use it in GitHub Desktop.
pelotonCode
import sqlite3
from flask import Flask, render_template
app = Flask(__name__)
conn = sqlite3.connect('example.db')
c = conn.cursor()
c.execute("SELECT * FROM emails")
conn.commit()
@app.route("/")
def hello(name="HAPPPPPPY"):
return render_template('hello.html',name=name)
@app.route("/MO")
def MO():
return "strinsadfadsfadsfadsfadsfdasg"
@app.route("/MO/cypher")
def JIMMY():
rose = c.fetchone()
return str(rose[0] + rose[1])
if __name__ == "__main__":
app.run(host='0.0.0.0')
@plasx
Copy link
Author

plasx commented Dec 14, 2016

https://docs.python.org/2/library/sqlite3.html

virtualenv venv
source venv/bin/activate
pip install flask
python app.py

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment