Local Python Server Installation

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


Steve,

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

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

________________________________________________

#!C:\prog\Python22\python.exe

import time

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

	<?xml version = "1.0" encoding = "UTF-8"?>
	<!DOCTYPE html PUBLIC
		"-//W3C//DTD XHTML 1.0 Strict//EN"
		"DTD/xhtml1-strict.dtd">
	<html xmlns = "http://www.w3.org/1999/xhtml">
	<head><title>%s</title></head>

	<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 

#!C:\prog\Python22\python.exe
^
 


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

Bummer.

Any advise?

Thank you.

Regards,
Kenneth.


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
>Apache.
>
>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.
>
>regards
>-----------------------------------------------------------------------
>Steve Holden                                  http://www.holdenweb.com/
>Python Web Programming                 http://pydish.holdenweb.com/pwp/
>Previous .sig file retired to                    www.homeforoldsigs.com
>-----------------------------------------------------------------------
>
>
>

Cheers,
Kenneth Gomez.



More information about the Python-list mailing list