This commit is contained in:
@ -167,23 +167,23 @@ if __name__ == '__main__':
|
||||
|
||||
c = db.execute("""
|
||||
insert into sequence (id,forward,reverse)
|
||||
values (%d,'%s','%s');
|
||||
""" % (seqid,tseq[0],tseq[1]))
|
||||
values (?,?,?);
|
||||
""" ,(seqid,tseq[0],tseq[1]))
|
||||
|
||||
db.commit()
|
||||
|
||||
for w in words:
|
||||
try:
|
||||
c = db.execute("""select id from words where word='%s';""" % w)
|
||||
c = db.execute("""select id from words where word=?;""" , (w,))
|
||||
wid = c.fetchone()["id"]
|
||||
except :
|
||||
db.rollback()
|
||||
wid = wordid
|
||||
c = db.execute("""insert into words (id,word) values (%d,'%s') ;""" % (wid,w))
|
||||
c = db.execute("""insert into words (id,word) values (?,?) ;""" , (wid,w))
|
||||
wordid+=1
|
||||
|
||||
|
||||
c = db.execute(""" insert into composition (seqid,wordid) values (%d,%d) ;""" % (seqid,wid))
|
||||
c = db.execute(""" insert into composition (seqid,wordid) values (?,?) ;""" , (seqid,wid))
|
||||
|
||||
db.commit()
|
||||
|
||||
|
Reference in New Issue
Block a user