M
M
Marat_RD2017-03-26 16:48:40
Python
Marat_RD, 2017-03-26 16:48:40

How to OUTPUT all rows from a sqlite database in python?

Hello.
The task is to display all rows from the sqlite database.

conn = sqlite3.connect('D:/squadybot.sqlite')
cur = conn.cursor()
cur.execute("SELECT * FROM tasks")
row = cur.fetchone()

But the object
row
contains only the first line. How to get everything out?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
J
javedimka, 2017-03-26
@Marat_RD

It is obvious to use the correct method - fetchall()
https://habrahabr.ru/post/321510/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question