Reinventing the wheel? cgi +xhtml

Jackson david.jay.jackson at wcox.com
Thu Oct 18 13:47:45 EDT 2001


Greeting -- I maybe reinventing the whell, but  here it goes.
Below is "xhmtl.py" which I'm using to create w3c valid XHTML pages. My quetions are:

1)Does a wheel already exist? besides cgi, maybe a template sys?

2)Can I use it as module the why it's define?
>>> import xhtml
>>> header()
>>> header
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
NameError: name 'header' is not defined



---------------     xhtml.py    ------------------
##!/usr/bin/python
#
# Define XHTML function
def header():
	print """<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>
<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\"
  	 \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">
<html xmlns=\"http://www.w3.org/1999/xhtml\">
<head>
  <meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\" />
  <title>title</title>
  <meta name=\"GENERATOR\" content=\"python-2.1:xhtml/cgi\" />
</head>

	"""

def footer():
	print """
</body>
</html>
			"""	






More information about the Python-list mailing list