H
H
HelpMeeee2021-01-04 20:38:44
Python
HelpMeeee, 2021-01-04 20:38:44

Why do I get strange code when querying sqlite3?

Hello!
Such a problem. I make a request to the database and get a strange response. This is how I make the call:

db = sqlite3.connect(config.database_name)
cursor = db.cursor()

question = cursor.execute('SELECT question FROM answers')
answer = cursor.execute('SELECT right_answer FROM answers')
db.commit()


I get this code as a response -<sqlite3.Cursor object at 0x03B9E7A0>

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
SashaN69, 2021-01-04
@SashaN69

Why db.commit() on SELECT ?

P
PavelMos, 2021-01-04
@PavelMos

The program is unfinished. Learn the basics. this is not a response from the database that the program processes, but just a temporary work object. After sending each request, you need to read the response using just this cursor.
https://python-scripts.com/database

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question