CoCalc Shared Fileswww / cgi-bin / mfd / mfe_glossary_html.pyOpen in CoCalc with one click!
Author: William A. Stein
1
#!/usr/bin/python
2
3
# parse the glossary request.
4
5
import cgi, mfd, mfe_glossary, constants
6
7
glossary = mfe_glossary.Glossary()
8
form = cgi.FieldStorage()
9
10
print "Content-Type: text/html" # HTML is following
11
print # blank line, end of headers
12
print "<html><head>"
13
14
if form.has_key("phrase"):
15
phrase = form["phrase"].value
16
else:
17
phrase = "Unknown"
18
19
print "<title>Modular Forms Explorer: Definition of %s</title>"%phrase
20
print '<link rel="stylesheet" type="text/css" href="/mfd/mfd.css" title="was">'
21
print "</head>"
22
print "<body class=top>"
23
24
print "<center>"
25
print "<table border=2><tr><td><table bgcolor=white border=0 cellpadding=10 cellspacing=10><tr><td>"#%constants.TABLE_BGCOLOR
26
print glossary.Define(phrase)
27
print "</td></tr></table></td></tr></table>"
28
print "</center>"
29
30
print "</body>"
31
print "</html>"
32