Possible Duplicate:
Python challenging string encoding
I am trying to put a list of tickers into a SQL query. I am new to Python.
cus is a list set up as ['x', 'y', ..., 'a']
test = psql.frame_query(
"select * from dataBase where cus IN (%r)", con = db) % cus
I tried this and it failed.
My next attempt was to try and remove the brackets and then paste the list in. How do I remove the brackets so that I get:
cus2 = 'x', 'y', ..., 'a'
I was going to do:
str = "select * from dataBase where cus IN (%r)" % cus2
test2 = psql.frame_query(str, con = db)
Or is there another way I should be attempting this?
Thank you.