我有以下代码片段:
import sqlite3
import cld
import langid
languagedata = [] #list for the returned data from database
n = -1
connector = sqlite3.connect("GERMANY.db")
selecter = connector.cursor()
selecter.execute(''' SELECT title FROM DATAGERMANY''')
for row in selecter: #iterate through all the rows in db
print (row)
lan = langid.classify("{}".format(row)) #identify the language
print (lan)
connector.execute('''update DATAGERMANY set title_abbreviation_langid=? , title_reliability_langid=? where id_db == ? ''',(lan[-2], lan[-1])
connector.commit() #save changes
connector.close()
我试了100次,效果很好。我添加了另一个for loop
,然后又删除了它。所以我不应该修改密码。但是现在我得到了一个Invalid Syntax
错误。你知道吗
怎么可能?!你知道吗
注意:没有关于错误的更多信息。你知道吗
此行缺少结束符:
我添加了一个结束参数,您的代码现在应该可以了。你知道吗
相关问题 更多 >
编程相关推荐