root/06/libkombilo-branches/hash_center_makedb/makedb.py

Revision 236, 502 bytes (checked in by ug, 2 years ago)

Fixed some issues with creating the frequency db.

Line 
1 from pysqlite2 import dbapi2
2
3 db = dbapi2.connect('t1.db2')
4 c = db.cursor()
5 c.execute('select hash,freq from algo_hash_19_CENTER where freq > 40 and freq < 5000;')
6 a = c.fetchall()
7 print 'retrieved data', len(a)
8
9 out = dbapi2.connect('kombilo.db')
10 outc = out.cursor()
11 outc.execute('create table if not exists frequency ( hash int, freq int );')
12 for hash,card in a:
13     # print int(hash), card
14     outc.execute('insert into frequency (hash, freq) values (?,?);', (hash, card))
15 out.commit()
16 out.close()
17
Note: See TracBrowser for help on using the browser.