Jun-01-2018, 08:52 PM
I think you may want to do some additional parsing, but as is:
perhaps you could show what you would like the tuples to contain.
Python 3.6.5 (v3.6.5:f59c0932b4, Mar 28 2018, 17:00:18) [MSC v.1900 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> the_string = "['sql statement %s where id = %s', ['test','1']]" >>> as_tuples = tuple(the_string.split())but I doubt that is exactly what you want.
perhaps you could show what you would like the tuples to contain.