Dec-01-2021, 09:55 PM
So you want to serialize the arguments to cursor.execute. You could do
import ast argstxt = "('SELECT Word FROM Tbwords WHERE word REGEXP ?', ['^.?.?P.?.?.?RE.?.?C.?.?.'])" args = ast.literal_eval(argstxt) cursor.execute(*args)