How to turn a list of tuples into a string?

Posted by matt on Stack Overflow See other posts from Stack Overflow or by matt
Published on 2010-05-24T12:54:03Z Indexed on 2010/05/24 13:01 UTC
Read the original article Hit count: 288

Filed under:
|

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?

© Stack Overflow or respective owner

Related posts about python

Related posts about tuples