Why can't replace placeholder with format function in pymysql?
问题 How i create the table mingyan . CREATE TABLE `mingyan` ( `tag` varchar(10) DEFAULT NULL, `cont` varchar(255) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; It's said that string format function with {} is more pythonic way than placeholder % . In my scrapy to write some fields into a table mingyan . self.cursor.execute("insert into mingyan(tag, cont) values (%s, %s)",(item['tag'],item['cont'])) It works fine in my scrapy,now i replace the placeholder way with string format function. self