CoCalc Shared Fileswww / cgi-bin / mfd / mfe_lratio.pyOpen in CoCalc with one click!
Author: William A. Stein
1
#!/usr/bin/python
2
3
import cgi, mfd, sys, constants
4
5
form = cgi.FieldStorage()
6
7
print "Content-Type: text/html"
8
print ""
9
10
if form.has_key("code"):
11
code = form["code"].value
12
else:
13
print "Missing code"
14
sys.exit(0)
15
16
if form.has_key("j"):
17
j = form["j"].value
18
if j != "all":
19
j = int(j)
20
else:
21
print "Missing j"
22
sys.exit(0)
23
24
M = mfd.ModSym(code)
25
lratio = M.lratio()
26
if lratio == constants.not_computed or (j != "all" and (j < 1 or j > len(lratio))):
27
ans = 'lratio[%s] := "unknown";'
28
else:
29
if j == "all":
30
ans = "lratio := %s;\n"%lratio
31
ans = ans.replace("'","")
32
else:
33
ans = "lratio[%s] := %s;\n"%(j,lratio[j-1])
34
35
print "// LRatio L(%s,%s)/Omega_%s<br><br>"%(code,j,j)
36
print ans
37
38