I have a list of tuples that I'm trying to incorporate into a SQL query but I can't figure out how to join them together without adding slashes. My like this:
list = [('val', 'val'), ('val', 'val'), ('val', 'val')]
If I turn each tuple into a string and try to join them with a a comma I'll get something like
' (\'val\, \'val\'), ... '
What's the right way to do this, so I can get the list (without brackets) as a string?
I want to end up with::
q = """INSERT INTO test (feed,site) VALUES %s;""" % string
string = " ('val', 'val'), ('val', 'val'), ('val', 'val') "