G
Gilles
Hello
I'm learning how to call Python scripts through the different
solutions available.
For some reason, this CGI script that I found on Google displays the
contents of the variable but the HTML surrounding it is displayed
as-is by the browser instead of being rendered:
--------------
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
# enable debugging
import cgitb
cgitb.enable()
import cgi
form = cgi.FieldStorage()
# get a value from the form
value = form.getvalue("dummy")
print "Content-Type: text/plain;charset=utf-8"
print
# print a document
print "<P>You typed: <TT>%s</TT></P>" % (
cgi.escape(value),
)
I'm learning how to call Python scripts through the different
solutions available.
For some reason, this CGI script that I found on Google displays the
contents of the variable but the HTML surrounding it is displayed
as-is by the browser instead of being rendered:
--------------
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
# enable debugging
import cgitb
cgitb.enable()
import cgi
form = cgi.FieldStorage()
# get a value from the form
value = form.getvalue("dummy")
print "Content-Type: text/plain;charset=utf-8"
# print a document
print "<P>You typed: <TT>%s</TT></P>" % (
cgi.escape(value),
)