>>> cur.execute("INSERT INTO foo VALUES (%s)", "bar") # WRONG
>>> cur.execute("INSERT INTO foo VALUES (%s)", ("bar")) # WRONG
>>> cur.execute("INSERT INTO foo VALUES (%s)", ("bar",)) # correct
>>> cur.execute("INSERT INTO foo VALUES (%s)", ["bar"]) # correct
---------------------
作者:IMrChang
来源:CSDN
原文:https://blog.csdn.net/chang1976272446/article/details/73498683?utm_source=copy
not all arguments converted during string formatting Python+mysql 写入数据库的的错误
最新推荐文章于 2024-04-11 16:48:34 发布