|
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 |
|
|---|
| 14 |
outc.execute('insert into frequency (hash, freq) values (?,?);', (hash, card)) |
|---|
| 15 |
out.commit() |
|---|
| 16 |
out.close() |
|---|
| 17 |
|
|---|