sqlite problem with python
Publicado por Juan (2 intervenciones) el 05/06/2012 01:26:00
hey any of you guys could help me?? i have a problem with a script Im making for school, im trying to update a table dependeing if a word was spelled right or wrong, the code tu spellcheck works fine its just that the value on the table does not get updated :/
this is the code hope someone can help me
def wordspell(self):
d = enchant.Dict("en_US")
palabras = self.con.execute(' select rowid, word from wordlist').fetchall()
for row in palabras:
check = d.check(row[1])
if check :
print "true "+str(row[0])
self.con.execute("UPDATE wordlist SET error=? WHERE rowid=?",('no',row[0]))
else:
print "false "+str(row[0])
self.con.execute("UPDATE wordlist SET error=? WHERE rowid=?",('si',row[0]))
it does print whether the word is correct or not the value on the db never gets updated :/
this is the code hope someone can help me
def wordspell(self):
d = enchant.Dict("en_US")
palabras = self.con.execute(' select rowid, word from wordlist').fetchall()
for row in palabras:
check = d.check(row[1])
if check :
print "true "+str(row[0])
self.con.execute("UPDATE wordlist SET error=? WHERE rowid=?",('no',row[0]))
else:
print "false "+str(row[0])
self.con.execute("UPDATE wordlist SET error=? WHERE rowid=?",('si',row[0]))
it does print whether the word is correct or not the value on the db never gets updated :/
Valora esta pregunta


0