Local Python Server Installation

Kenneth Gomez kennethg at pd.jaring.my
Fri Sep 27 17:44:49 CEST 2002


I stumbled onto this problem while going through the first exmaple in
the book Python:How to Progra, by Deitel, Deitel, Liperi and

My little code sniipet, copied exactly from the book except for the
path to my python exe is :



import time

def printheader(title):
	print """Content-type: text/html

	<?xml version = "1.0" encoding = "UTF-8"?>
		"-//W3C//DTD XHTML 1.0 Strict//EN"
	<html xmlns = "http://www.w3.org/1999/xhtml">

	<body>""" % title

printheader("Current Date & Time")
print time.ctime(time.time())
print "</body></html>"

I get the following error in IE6 :

The XML page cannot be displayed 
Cannot view XML input using style sheet. Please correct the error and
then click the Refresh button, or try again later. 


Invalid at the top level of the document. Error processing resource
'http://localhost/ken.py'. Line 1, Position 1 


and when using Mozilla 1.0, all I get is the listing of the script.


Any advise?

Thank you.


On Fri, 27 Sep 2002 09:16:41 -0400, "Steve Holden"
<sholden at holdenweb.com> wrote:

>"Kenneth Gomez" <kennethg at pd.jaring.my> wrote in message
>news:3d8d4009.375344 at news.jaring.my...
>> Chris, you're right. It's an Apache config problem. I'll dig into the
>> doc's.
>The Wrox book "Professional Apache 2.0" is helpful if you need to understand
>how Apache works and, despite its title, it alos covers older versions of
>If you want to write servers in pure Python you could look at "Python Web
>Programming", but you will probably find you can get a lot further than you
>thought with simple CGI, then you'll know enough about other directions
>you'd like to go.
>Steve Holden                                  http://www.holdenweb.com/
>Python Web Programming                 http://pydish.holdenweb.com/pwp/
>Previous .sig file retired to                    www.homeforoldsigs.com

Kenneth Gomez.

More information about the Python-list mailing list