CoCalc Shared Fileswww / cgi-bin / mfd / mfe_aplist.pyOpen in CoCalc with one click!
Author: William A. Stein
1
#!/usr/bin/python
2
3
# mfe_aplist.py
4
# (c) William Stein, 2001, [email protected]
5
6
import cgi # cgi-bin
7
import Documents, HTML
8
9
import misc
10
import constants
11
import mfd # modular forms database
12
13
import os, string
14
15
print "Content-Type: text/html" # HTML is following
16
print # blank line, end of headers
17
18
form = cgi.FieldStorage()
19
20
if not form.has_key("code"):
21
print "<h1>Error</h1>"
22
print "The mfe_aplist.py python script was called from an invalid form."
23
print "This means William Stein ([email protected]) made a mistake somewhere, "
24
print "or our web client did something funny."
25
print "Please let him know how you caused this error message."
26
27
##################################
28
29
code = form["code"].value
30
f = mfd.ModSym_From_Code(code)
31
N = f.level
32
k = f.weight
33
34
doc = Documents.Document()
35
doc.append(HTML.TITLE('The Modular Forms Explorer: Hecke Eigenvalues of %s'%code))
36
doc.append(HTML.LINK(rel="stylesheet", type="text/css", \
37
HREF="/mfd/mfd.css", TITLE="was"))
38
39
body = HTML.BODY(klass="top")
40
doc.append(body)
41
42
body.append(HTML.CENTER(HTML.H1('The Modular Forms Explorer')))
43
body.append(HTML.CENTER(HTML.FORM(\
44
HTML.INPUT(type="submit", name="button", value="Go to N=%s, k=%s"%(N,k)),\
45
HTML.INPUT(type="hidden", name="level", value=str(N)), \
46
HTML.INPUT(type="hidden", name="weight", value=str(k)), \
47
HTML.INPUT(type="hidden", name="iso_class", value="0"), \
48
action="%s/mfe_full_html.py"%constants.CGIROOT, method="POST")))
49
50
body.append(HTML.HR())
51
body.append(HTML.H2("Hecke eigenvalues of %s"%code))
52
53
maxp = f.aplist_maxp()
54
body.append('Complete list of Hecke eigenvalues <i>a<sub>p</sub></i> for p <= %s '%maxp +\
55
'(<a href="/mfd/mfe/aplist_notation.html">notation</a>):<br>')
56
57
aplist = f.aplist()
58
aplist = string.replace(aplist, '\n', '')
59
aplist = string.replace(aplist, ' ', '')
60
aplist = string.replace(aplist, ',[', ', [')
61
aplist = string.replace(aplist, '[[', '\n[[')
62
aplist = string.replace(aplist, ']],', ']],\n')
63
64
body.append("\n<tt><\n "+aplist[1:-1] + "\n></tt>")
65
66
print doc
67
68
69
70