I\'ll admit it. I\'ve been doing this for literally decades:
sql = \'select * from whatever where key = "%s"\' % (\'thing\') cursor.execute(sql)