我有一个基本上通过从" where.data"中获取位置来创建数据库的代码。文件然后与base_url正确连接以点击googlemaps api。初始代码是用python 2.7编写的,我对特定的代码行有错误 `
fh = open("where.data")
count = 0
for line in fh:
if count > 200 : break
address = line.strip()
print ('')
cur.execute("SELECT geodata FROM Locations WHERE address=?",repr(memoryview(buffer(address))), ))
try:
data = cur.fetchone()[0]
print ("Found in database ",address)
continue
except:
pass