Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

select statement python

#connect to sqlite database in python

import sqlite3

connection = sqlite3.connect("survey.db")
cursor = connection.cursor()
cursor.execute("SELECT Site.lat, Site.long FROM Site;")
results = cursor.fetchall()
for r in results:
    print(r)
cursor.close()
connection.close()
Source by pymotw.com #
 
PREVIOUS NEXT
Tagged: #select #statement #python
ADD COMMENT
Topic
Name
4+3 =