Articles → Python → Read Data From SQLite Table Using Python

Read Data From SQLite Table Using Python






Example




import sqlite3

conn = None

conn = sqlite3.connect(r"C:\temp\gyansangrah\SchoolDB.db")
cursor = conn.execute("SELECT * from Departments1")
for row in cursor:
    print (row[0])
    print (row[1])

conn.close()



Output


Picture showing the output of how to read data from Sqlite table using python



Posted By  -  Karan Gupta
 
Posted On  -  Wednesday, June 5, 2019

Query/Feedback


Your Email Id
 
Subject
 
Query/FeedbackCharacters remaining 250