Questions tagged [pset9]
The pset9 tag has no usage guidance.
59
questions
0
votes
1
answer
32
views
RuntimeError: API_KEY not set /pset 9
im using the flask run commend in the finance directory but still i get the RuntimeError: API_KEY not set .
and flask-session has alredy the api-key
0
votes
0
answers
27
views
pset9 Finance Check50 bot says submission button not found
I have completed my application for pset9 and have all functions working properly, however check50 doesn't agree with my register implementation. Apparently, I do not have a submission button, however ...
0
votes
0
answers
17
views
PSET9 Finance: USD function returns error only when both rendering Index AND after BUY completes a 'purchase'
"unsupported format string passed to Undefined.format"--I know this happens because the non-numerical value is passed into the USD function, but I can't seem to spot the culprit.
As ...
0
votes
1
answer
25
views
PSET9 FINANCE SQLITE "no such column exists" while multiplying two columns to update a third
In the Index function on APP.PY of my finance code, I'm getting "RuntimeError: no such column: total_per_share" even though I'm using "AS" to create this column -- please advise.
@...
1
vote
1
answer
18
views
cs50 finance - RuntimeError: unsupported value: <function buy at 0x7f1c380cfd90>
@app.route("/buy", methods=["GET", "POST"])
@login_required
def buy():
"""Buy shares of stock"""
if request.method == "POST":
...
0
votes
0
answers
230
views
Here is my cs50 finance /buy code
@app.route("/buy", methods=["GET", "POST"])
@login_required
def buy():
"""Buy shares of stock"""
if request.method == "POST":
...
0
votes
0
answers
6
views
PSET 9: Should I use a separate table for symbols?
Symbols will repeat themselves, since different users can buy shares from the same company, so when creating the portfolio table to store data related to the purchase of shares, I thought I could ...
0
votes
1
answer
15
views
PSET 9: C$50 Finance. Why not <input type="number"> instead of text?
From CS50's Problem Set 9 specification:
Require that a user input a number of shares, implemented as a text field whose name is shares. Render an apology if the input is not a positive integer.
I'm ...
0
votes
1
answer
115
views
Lab 9: Birthdays - odd behaviour from delete button
I got Lab 9 up and running per spec and am trying to implement a 'delete' button for each row.
My current code works fine to delete each row in the table except for the first row (id = 1).
When I ...
0
votes
0
answers
19
views
PSET9 finance: lookup always returns 404 None or 200 None
I reinstalled helpers.py and the entire IEX key is being submitted (IEX console shows credit is being used--see attached photo) but I keep getting:
https://cloud.iexapis.com:443 "GET /stable/...
0
votes
0
answers
31
views
PSET9 - TypeError: 'NoneType' object is not subscriptable
My code for pset9 - Finance runs well on my IDE but some how Check50 still reports a log in error, which I don't know why since log in function was provided in the distribution code.
Here is my code:
...
0
votes
0
answers
39
views
PSET9 finance 'buy handles valid purchase error' checking that "112.00" is in page
Hi there I am stuck on PSET9 Finance. When I run check50 I get this error. I think this is when the page is getting redirected to the index page. I have added my python route for buy below and index ...
0
votes
1
answer
78
views
ValueError: UNIQUE constraint failed: on finance pset9, could someone point me in the right direction on which values should be UNIQUE from my table?
Could someone help me figure out which values should I define as UNIQUE? I'm getting the ValueError: UNIQUE constraint failed: compras.id beacuase of the way I created my table for keeping tab of who ...
0
votes
0
answers
27
views
PSET 9 Finance checking that "56.00" is in page
I've been trying to solve this issue for hours and every time I run the code I get the error:
****:( sell handles valid sale
Cause
expected to find "56.00" in page, but it wasn't found
Log
...
0
votes
0
answers
20
views
PSET9 Finance - Check50 Failing on login - logging in as registered user succceeds -NameError: name 'get_symbol'
@app.route("/")
@login_required
def index():
"""Show portfolio of stocks"""
print("before")
# Store the user_id.
user_id = session["user_id"]...
0
votes
0
answers
31
views
What is the best approach to DB design? (CS50X PSET9)
I'm pretty excited going over the pset9, however, I have a question when it comes to db design.
The following text might be a spoiler to the solution of the problem set, beware.
Given the above ...
0
votes
1
answer
35
views
FINANCE SELL : DROPDOWN MENU not showing any option DESPITE having look for solutions
This is my first time posting on reddit asking for help : I've been so far going through cs50 on ressources online when I got stuck, but here I can't figure it out even tho with the numerous online ...
0
votes
0
answers
72
views
Pset9 - Finance sell function not working
Can anyone help me with this problem?
check50 keeps returning these lines, but I don't know what is the problem, since the web application works fine when I test it manually.
:( sell handles invalid ...
0
votes
0
answers
16
views
Finance: how does the "errorhandler" work?
I am trying to understand the errorhandler function in pset9 finance. In the given application.py:
# Original version
def errorhandler(e):
"""Handle error"""
if ...
0
votes
1
answer
70
views
Cs50 Finance :(sell handle valid sales :values appearing in index table but check50 doesnt recognise it
updated the code to display history properly,ie when sold shows negative,and when bought shows positive
updated index to remove entire row when stocks is 0
I cant figure out why check 50 is not ...
0
votes
1
answer
74
views
Check50 says buy allows fractional, negative numbers but it doesn't. Where am I going wrong?
I'm down to my last check50 frown (:( buy handles fractional, negative, and non-numeric shares
expected status code 400, but got 200) but my code doesn't allow for these, so I don't know what to do. ...
0
votes
1
answer
138
views
jinja code not working inside html file
I am using flask for the first time and jinja code is being displayed on the webpage.
this is my html file:
<!DOCTYPE html>
<html lang="en">
<head>
...
0
votes
1
answer
75
views
Why does my lookup function keep returning "None"?
I have the latest (I think) distribution code and I have exported the API key. Here is my code and it keeps returning 'None'. I can't figure out why I can't look up a stock quote. Do I need to change ...
0
votes
0
answers
22
views
How do I get an API key from IEX?
I've just started on pset9 finance, but I can't create an account with IEX. When I try, it tells me that my email address is already in use (this is definitely not true - I'm using a relatively new ...
0
votes
1
answer
131
views
PSET9 / can't check until a frown turns upside down
I am getting this message in the following checks
:| sell page has all required elements/
:| sell handles invalid number of shares
:| sell handles valid sale
I guess the problem is in by sell or buy ...
0
votes
0
answers
38
views
Pset9 problem at check50 tests
hello, i've tried "112.00" in my solution and cs50's solution and the result is same "invalid shares" but i don't know why this error occur.
i'm really stuck any help please
0
votes
1
answer
71
views
pset9: finance // jinja syntax error in index
I'm working on my index page and I have two errors. For the first, I'm not sure what's wrong. It seems like it's something with my return statement but I have no idea what's wrong with it.
File "...
0
votes
1
answer
85
views
I'm on pset9 right now and I'm running check50 on my code and getting :( logging in as registered user succeeds expected status code 200, but got 403
I've tried everything that I thought could be the problem but nothing is working.
I registered and tried logging in but I keep getting '403 Invalid username and/or password' error
This is my login ...
0
votes
0
answers
56
views
Pset Finance - issue with usd
I'm stuck with pset9 Finance...
When I try to sell a quote and return to index.html, I have an error with :
File "/home/ubuntu/pset9/finance/templates/index.html", line 1, in top-level ...
0
votes
1
answer
100
views
check50 errors for "buy" and "sell"
I get below errors from check50:
:( buy handles invalid ticker symbol
application raised an exception (see the log for more details)
:( buy handles fractional, negative, and non-numeric shares
...
0
votes
1
answer
56
views
What mistake am I doing in the below "buy" and "sell" code.? I get the below errors from check50
I get the below error from check50:
:( buy handles invalid ticker symbol
application raised an exception (see the log for more details)
:( buy handles fractional, negative, and non-numeric shares
...
0
votes
1
answer
140
views
Pset 9 Finance index function, current stock price not displaying correctly
I am working on getting the proper information to display on the index page. I have one piece left, and it is displaying the current value of the stock. When I look at my output for my 'user' and '...
0
votes
0
answers
22
views
My "register" function in pset9 is not working
What mistake am I doing in the code below for pset9 "register" function:
@app.route("/register", methods=["GET", "POST"])
def register():
"""...
0
votes
1
answer
43
views
Buy/Sell on Index - button attributes & form value issues
I've got a couple issues adding my own buy/sell buttons to the index page.
First, each "Buy" or "Sell" buttons opens up the form for all of the table rows. How can I modify these ...
0
votes
0
answers
246
views
Pset 9 finance-Problems for type= number output on the webpage
I am working on a CS50 task called "finance".
The problem is that I get an error when I want to check the integer value of the share amount and put it on a separate template for checking my ...
0
votes
1
answer
81
views
check50 on finance pset
I'm having 2 problemas with my check50:
:( buy handles fractional, negative, and non-numeric shares
:( sell handles invalid number of shares
As shown in the code below, my input in buy and sell is ...
0
votes
1
answer
52
views
Buy Finance Pset9 Cash not working
I am working on pset9 finance and I have been stuck for a while on it, especially this part:
cash = db.execute("SELECT cash FROM users WHERE user_id = :userid", userid=
...
0
votes
1
answer
146
views
PS9 Finance - Check50 - :( buy handles valid purchase
I am running into an issue with check50 on my buy function. Check50 gives me the following error:
:( buy handles valid purchase
Cause
application raised an exception (see the log for more details)
...
0
votes
1
answer
80
views
Pset9 Finance Sell select menu
I'm doing the "sell" part of the Finance pset.
I am trying to display the stocks someone is able to sell on a HTML page with a select menu.
The problem is that they don't display properly on ...
0
votes
1
answer
46
views
Pset9 Finance - How do I load the symbol into my input box on the Buy.html?
I am successfully getting the symbol from the button (as see in image) but I am not sure how load it into the text field as value to be submitted. Please help....
@app.route("/buy", ...
0
votes
1
answer
28
views
How to access the values returned by SELECT SUM
I am trying to create the table in pset9 finance to display what stocks the user has. My current attempt tries to do this by summing up the number of stocks in past transactions the user has made.
I ...
0
votes
1
answer
25
views
Why is the portfolio not being displayed? I get not errors but nothing is being displayed. I am at a loss as to why I cannot display any stocks
@app.route("/")
@login_required
def index():
"""Show portfolio of stocks"""
rows = db.execute("SELECT symbol, SUM(shares) as Total_shares FROM ...
0
votes
1
answer
240
views
PSET 9 Quote function not working correctly
Lookup function always returns "None". Weirdly the same code produced correct results yesterday but as of today it stopped. Any thoughts why? The code for the quoted.html and application.py ...
0
votes
1
answer
86
views
Runtime Error Unsupported Value in pset9 Finance
I'm doing Pset09 "Finance" and I have been stuck in the "index" function for quite a while. I tried to use the already existing "trans" table but I am getting an error. ...
0
votes
0
answers
15
views
pset9 finance // expected to find "112.00" in page, but it wasn't found [duplicate]
Hi I was testing out my code for the buy function to buy a stock but once I tried to buy a stock it gave me this error:
expected to find "112.00" in page, but it wasn't found
and I am not ...
0
votes
1
answer
242
views
pset9 buy function // buy handles invalid ticker symbol and handles valid purchase having error
I ran check50 to check some things that were wrong and I got 2 errors but when i check the details of the error it doesnt really give me a detailed overview of the problem so I am not really sure how ...
0
votes
0
answers
45
views
PSET 9Help with SyntaxError: invalid syntax error
The SyntaxError: invalid syntax error points me to line 75, but I cant see what is wrong there. Please I need help to identify possible reason. When i run Flask, the server crashes.
192.168.1.172 -...
0
votes
1
answer
313
views
CS50 Finance check50 problem in sell function, it works fine when i test it as well but idk what the problem is
I tried my solution multiple times and compared it to the staff's solution as well but there is an check 50 error saying ":( sell handles valid sale
expected to find "56.00" in page, ...
0
votes
2
answers
63
views
What is the difference between Finance in 2020 and 2021
Please I want to ask What is the difference between Finance in 2020 and 2021. I have tried the problem set in 2020, I want to know as it might help em know how to proceed.
0
votes
1
answer
72
views
pset9 finance // index function doesnt display the sum of the shares
I am doing pset9 finance and I am kind of stuck because whenever I buy for example FB stocks multiple times it doesn't sum up in to show in the index function.
this is the code:
@app.route("/&...