-
-
Save anonymous/a97f6c4eb5a834f2c99fe9e5f1e919ee to your computer and use it in GitHub Desktop.
application.py - shared from CS50 IDE
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def index(): | |
total = 0 | |
cash = db.execute("SELECT cash FROM users WHERE id=:id", id=session["user_id"]) | |
symbol = db.execute("SELECT symbol FROM tracker where id=:id", id=session["user_id"]) | |
rows=lookup(symbol[0]) | |
shares = db.execute("SELECT shares FROM tracker where id=:id", id=session["user_id"]) | |
price = db.execute("SELECT price FROM tracker where id=:id", id=session["user_id"]) | |
return render_template("index.html", cash=usd(cash[0]["cash"]), symbol=symbol[0]["symbol"], \ | |
shares=shares[0]["shares"], price=price[0]["price"], \ | |
cost=price[0]["price"]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment