access sqlite db python
import sqlite3
#Connection to the DB
conn = sqlite3.connect('sqlite.db')
# Execute query on the sqlite DB
cur = conn.cursor()
cur.execute("SELECT * FROM tasks")
# Print everything from a table
rows = cur.fetchall()
for row in rows:
print(row)
# Update field
conn.execute("""UPDATE tasks SET name = \'jhon\'
where id = 1""")
# close the DB connection
conn.close()