Python 2.7 (Windows)
for root, dirs, files in os.walk(self.DiskLocation, topdown=False):
for name in files:
path = os.path.join(root, name)
print path #check it's what we think it is
self.cur.execute("SELECT * from myTable WHERE Path = ?", (path))
产生这个...
sqlite3.ProgrammingError:提供的绑定数量不正确。当前语句使用 1,提供了 54 个。
我真的很困惑 54 提供的绑定是什么,直到我意识到我的路径变量是 54 个字符。但是为什么 sqlite 将其解释为一长串字符而不是字符串,我该如何阻止它这样做呢?