conn = sqlite3.connect('blah')
cursor = conn.cursor()
query = ['gg','ff' , 'aa']
for i in query:
cursor.execute(select value from history where NAME = i]
this returns a error. Any links or help would be appreciated.
cursor.execute()takes in a string, not a series of variables. Right now, Python is trying to evaluate
select value from history where NAME = ias a series of variables. Also,
cursor.executeends in a square bracket rather than a normal parens.
@IETSilencer what you want in the
cursor.execute() is something like this
# Create table cursor.execute('''CREATE TABLE stocks (date text, trans text, symbol text, qty real, price real)''')
So you'll want to dynamically build the query string using Python and then put that created string as an argument to