Answer the question
In order to leave comments, you need to log in
How to read data from database into sqlite using python?
The user has a city in the database, for example "Moscow". Outputting it with code:
cursor.execute("SELECT bdname FROM user_city")
place = str(cursor.execute)
<built-in method execute of sqlite3.Cursor object at 0x00000201140B82D0>
Answer the question
In order to leave comments, you need to log in
Because you need to read the documentation , there are code examples on the very first couple of pages, including a SELECT query.
What do you expect to get by calling str(cursor.execute) if you know that cursor.execute() is a method?
And why are you ignoring its return value when you make a request?
More shortly, once again - read docks. They are helpful.
for row in cursor.execute('SELECT bdname FROM user_city'):
print(row)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question