Questions tagged [python]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
0answers
63 views

API Goodreads issue with the book page

I have been facing an issue with the API, it does not display in the book page in project1 I keep getting the error "Not Found" could someone help me? Check the screenshots of the python code below, ...
0
votes
0answers
4 views

Seding email with python smtplib

For the final project, I'm creating a website that will send a form's of the website to an email address. I'm using flask in python and smtplib in the CS50 IDE. I receive the following error ...
0
votes
1answer
15 views

Caesar in Python

On cs50 IDE, for problem set 6 Caesar, it keeps saying my program is wrong and giving me a 37% but it compiles perfectly. I checked with check50 and everything it say's it doesn't do it does precisely....
0
votes
1answer
16 views

Case sensitivity of keyword in pset 6 Python Vigenere

I've been stuck on Vigenere in pset6 for a few days now, and I've finally got it. It somehow took me longer to do Vigenere in Python than in C, interestingly. But, I'm confused about one thing: why do ...
0
votes
0answers
14 views

Python imports does'n work

[![ Hi, working on my final project i am getting this error, and because of that i cannot use any library, does anybody know what's going on ?
0
votes
1answer
16 views

Final project (very similar to Finance) : How can I delete selected row of table?

In mynote.html, there is a table of words. It is very similar to history.html or index.html of Finance (pset8). I want to upgrade it for my final project, so I tried to make 'delete'. But, there is a ...
0
votes
1answer
50 views

Pset8 Finance problems with SQLite inserting into a table

Inserting into a table in finance.db fails. I'm able to run the sqlite3 command via cli without errors and populate the table with the debugging snippet command: INSERT INTO history (date, symbol, ...
0
votes
1answer
28 views

pset8 New errors without changing any old code [duplicate]

I've been working hard on pset8 lately and making great progress. I was busy and didn't get to work on it for about a week. I'm now getting errors that I didn't get before, and as far as I'm aware, I ...
0
votes
1answer
45 views

Stuck on Caesar, analyzing command line arguments

I've posted my code blow. I'm supposed to check if the 2nd command line argument (the key) is an number or not, and if it is, print it out as an integer. I'm having two issues: I get an error ...
0
votes
2answers
22 views

How to pass value from HTML to python?

I'm setting up a new project in python ,and want to setting up a web pageresturant.html using FLASK , this code in html get the selected value from drop down box when button is clicked ,how can i pass ...
0
votes
1answer
36 views

PSET 6 [Similarities - less] How is the compare file accessed in this problem since it is not imported to application.py

(Dont be intimidated by length of code chunks, I included all of my guess as to what's going on, so most of it is just stuff to skim over) The folder similarities contains static and template folders ...
0
votes
1answer
55 views

Cannot run Flask - TypeError

Whenever I try "flask run" I get this error in the IDE. I have no idea what the problem actually is. ~/workspace/pset7/survey/ $ flask run * Serving Flask app "application.py" (lazy loading) * ...
0
votes
1answer
38 views

python pset1 cash problem

Trying to solve pset1 cash less comfortale with python. Whats my mistake as I cant figure it out. Lets say I add 5.16 as cash owed that is 20*0.25+1*0.1 +1*0.05 +1*0.01 , 23 coins total used. ...
0
votes
1answer
222 views

Instance of 'scoped_session' has no 'commit' member

I'm working on the project1 from cs50web course. Getting the following problem using flask and SQLAlchemy: "Instance of 'scoped_session' has no 'execute' memberpylint(no-member)". I use Ubuntu 18....
0
votes
0answers
19 views

not supported between instances of 'tuple' and 'float' podrían decirme por que sale este error en este alforitmo?

not supported between instances of 'tuple' and 'float' podrían decirme por que sale este error en este alforitmo? def mayor(): diccionario=dict() archivo=open("datos.csv","r") print("...
1
vote
1answer
90 views

pset 7 survey: trying to redirect to /sheet returns invalid syntax error

For part of CS50's survey problem from pset7, I'm supposed to redirect from a route that checks if the user has entered in all the survey's fields / appends the values to a csv file --> a route that ...
0
votes
1answer
82 views

CS50 Bleep Incorrect Output

I am encountering a problem in CS50 Bleep. When censoring the message, the censored message consists of only one * for the entire word, rather than the length of the word. Here is my code: from cs50 ...
0
votes
1answer
24 views

PSET 6: Sentimental [Mario.py(less)]: How exactly do I “reject input” in Python as specified in check50?

this is my first time posting on here and I'm trying to not break any rules but sorry if I do. So, I followed the specification to make mario.py ( they are the same ones for mario.c ) in Sentimental ...
0
votes
1answer
18 views

CS50 finance/sell: DB not updating cash

I am currently working on the finance assignment however I am facing some difficulties updating the cash variable into my users database. All other database updates work fine but when it tries to ...
0
votes
1answer
38 views

CS50 Pset6: cash.py not returning number of coins used for change

Below is my code for pset6 of CS50, in which the user is prompted for an amount of change in the form of a float, which is converted into cents (e.g. 1.25->125), and the fewest coins needed to make ...
0
votes
1answer
29 views

Pset6 credit python Problem

I try to convert my Credit Solution from C to Python now. But on Line 19 ( doubleCheck = ccNumber[i] * 2 ) i always get the error "TypeError: 'int' object is not subscriptable"! How can i fix this? ...
0
votes
1answer
142 views

pset6 bleep: Problem with difference between list and string

I assume that I have the following problem: I create a list for the banned words and although a list with the text input. Then I want to compare both list. But when I create the list of the user ...
0
votes
0answers
83 views

Crack(python) very slow

from sys import argv from crypt import crypt from string import ascii_letters from itertools import product if len(argv) != 2: print("Incorrect number of arguments") exit() hashed_p = argv[1]...
0
votes
1answer
275 views

AttributeError: __enter__

I defined a table in python using sqlalchemy but when i try to create it this error appears
1
vote
1answer
249 views

PSET6 CRACK (python)

I'm stuck on Crack (in Python). I wrote the following code, which I think should cover every case, however it runs for hours without finding a solution. Any thoughts/advice are appreciated. from sys ...
0
votes
2answers
115 views

Can't Connect Python Flask With PSQL Database

every time i try to make connection between python and PSQL this error disappear ?
2
votes
1answer
145 views

CS50 Finance: Register unique username (/check) problem: pythion GET function not working

I am working on the new /check additional on the Finance problem. I am trying to prevent the register form from being submitted when the username is already taken, is empty, or is just one character. ...
0
votes
0answers
42 views

Issue with CS50W's Project2 - submitted text not passed to chat window

I have a problem regarding passing posted messages into the proper field and presenting them to the user. The app is supposed to transfer the text submitted in "messenger" into the "messages" so to ...
1
vote
1answer
55 views

pset7 similarities: c-style loop vs generator

I am working on the similarities helpers.py. On checking check50, I found that the generator below does not work as intended, where input is ('This is one. This is two. This is three. This is two. ...
0
votes
0answers
31 views

How to integrate handlebars(written in raw javascript) into django templates

Please, I'm still rather new to handlebars templating, my handlebars template works perfectly with just html files, but when I try to render the page containing the handlebars template, I get all sort ...
1
vote
1answer
57 views

problem with pset6 python credit

Below is my code: [hidden code] output is: Enter the card number: 378282246310005 firstTwo 37; firstOne 3; cardlen 15 MASTERCARD note: it shows MASTERCARD instead of AmEx..Why?
0
votes
1answer
31 views

PSET7 variable not defined for sql statement

This is a chunk of my code from buy: if total_cost <= cash_balance[0]["cash"]: user_id = session["user_id"] cash_remaining = cash_balance[0]["cash"] - total_cost #db....
1
vote
1answer
33 views

Python Caesar not working for mix case etc

I've pretty much gotten my program to work 90% successfully! But, it does not produce the correct outcome for mix case or spaces/symbols. I've tried a number of different methods to no avail. At the ...
0
votes
1answer
97 views

Final Project - Problem uploading files to IDE folder

Update: Does anyone know hot to get the folder's absolute path? It isn't ~/workspace/fp/documentos/ or any of it's variations, such as /workspace/fp/documentos/ or workspace/fp/documentos/. It seems ...
0
votes
1answer
13 views

Why can't I break out of this while loop in python 2.7?

I've used a very similar loop in the past and had no issues. Here is the code: while(1): # Read the file file = open("db.csv", "r") # Get a line from the file line = file.readline() ...
0
votes
1answer
20 views

PSET8 invalid sw.

When I am trying to use the search bar, the autofill just gives me " , , " and when I click on that suggestion the console tells me "invalid sw". After reasearching the problem a bit, everyone seems ...
1
vote
1answer
185 views

PSET6 Similarities (more) Could Not Read File1

I am working on the distance function in pset6 similarities (more comfortable). When I run ./score cat ate, it gives me the error "could not read cat". I copied my code to another tab to test out my ...
0
votes
1answer
53 views

Project 1 Stuck on WHERE clause for Searching Books

I am working on Project 1 for CS50W on EdX. I am building the book search Flask app. My problem is with building the SQL SELECT statement utilizing the WHERE clause depending on the search fields. I ...
0
votes
1answer
2k views

Unable to run Flask App using Anaconda Prompt.Do Anaconda support Flask?

I am using Anaconda for editing and running scripts. In Anaconda prompt/command prompt, when I type this command : export FLASK_APP=application.py I am getting the error: "'export' is not recognized ...
0
votes
0answers
35 views

Mario.py works but gets different check50 results each time without changing a thing in the source code

Can someone please point out what's wrong with my code? from cs50 import get_int def main(): print("Height should be a positive integer between 0 and 23.") # a "do-while" loop to recieve a ...
0
votes
1answer
63 views

Should my distances function return the matrix in PSET6?

I'm working on the 'more comfortable' version of Similarities in PSET6. When I execute ./score wordone wordtwo, the IDE responds: 'Could not read wordone'. I initially thought the issue was my web ...
0
votes
1answer
149 views

pset6 hello, python3: can't open file 'hello.py': [Errno 2] No such file or directory

I just started working on pset6 using python for the first time. However, it keeps telling me no such file. Am I supposed to install python3 myself into IDE or what is wrong?
0
votes
1answer
123 views

Final Project TypeError: execute() got multiple values for argument

I have been working on my final project, which is a chat application. I am, however, facing a problem when it comes to sending the messages. I am implementing my project through an SQL database for ...
0
votes
1answer
33 views

The ide returns an error saying “ilist index out of range” pointing to the initialisation of int k

if (len(sys.argv) != 2): print("please enter a key") """understand the key""" k = sys.argv[1] """prompt for input text""" message = cs50.get_string("plaintext:") """get ready to produce ...
0
votes
1answer
120 views

intersection of a list of arrays, python

I have two arrays that have dictionaries within them (these dictionaries objects in both arrays contain identical keys): a = [{1:"a", 2:"b"},{1:"c", 2:"d"}] b = [{1:"e", 2:"f"},{1:"c", 2:"d"}] I ...
1
vote
1answer
201 views

SPEED: python vs C crack program

I have implemented a python and c version of crack way back from problem set 2. Both of them work, and both use the same algorithms/processing just expressed in two different languages. Out of ...
0
votes
1answer
77 views

pset7 check50 fails to load external python module pandas

I'm getting the following error from check50: :| application starts up check50 ran into an error while running checks! Log No module named 'pandas' ... File "application.py", line 3, in <...
0
votes
0answers
185 views

Crack - recursive (Python)

For the brute force password cracking method I have used this iterative approach. I tried to write a recursive function that did the same, but I am struggling. Could anyone give some pointers on ...
0
votes
1answer
275 views

Pset 7 - Finance: Clicking Register creates: AttributeError: 'ValueError'

I've been trying to get my register page to work for a couple days now. I think I'm close , but now I'm receiving the following error message in my terminal when I try to click register from the login ...
0
votes
1answer
202 views

Pset7 - Finance (register function) - creating internal server error

I've been trying to figure out the register function for some time now, but I just can't get it to work. I'm also receiving an invalid syntax error for the last line of the function: return redirect(...