Articles → Python → Read data from Sqlite table using python

Read data from Sqlite table using python






Example






import sqlite3

conn = sqlite3.connect('c:\sqlite\SchoolDB.db')

cursor = conn.execute("SELECT * from Departments")

for row in cursor:
   print (row[0])
   print (row[1])

conn.close()



Output



Click to Enlarge


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

Query/Feedback


Your Email Id  
 
Subject 
 
Query/FeedbackCharacters remaining 250