我正在努力找出我的代码有什么问题。我试图将数据输入到mysql中,python似乎不喜欢我所做的事情。在
试验数据
Name = "TestRegion"
Perent= "perent"
x1 = -100.0
x2 = -150.0
z1 = 94.0
z2 = 200.0
代码
^{pr2}$我想我的问题是如何将值传递给sql语句。在
我的错误消息是
File "/usr/lib/python2.7/dist-packages/MySQLdb/cursors.py, line 159, in execute
query = query % db.literal(args)
TypeError: not all arguments converted during string formatting
试试这个:
MySQL适配器不使用
?
作为占位符,而是使用%s
。在相关问题 更多 >
编程相关推荐