File: builder.py

package info (click to toggle)
sagemath-database-conway-polynomials 0.5-8
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye
  • size: 1,084 kB
  • sloc: python: 35,371; makefile: 6
file content (20 lines) | stat: -rw-r--r-- 411 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import os
from six.moves import cPickle

import sys
sys.path.append('.')
from table import conway_polynomials

db = {}
for p,n,v in conway_polynomials:
    if p not in db:
        db[p] = {}
    db[p][n] = v

dstdir = os.path.join('build')
dst = os.path.join(dstdir, 'conway_polynomials.p')
if not os.path.exists(dstdir):
        os.makedirs(dstdir)

with open(dst, 'wb') as f:
	cPickle.dump(db, f, protocol=2)