[Tutor] Python and web

Ignacio Vazquez-Abrams ignacio@openservices.net
Sun, 16 Sep 2001 16:33:21 -0400 (EDT)


On Sun, 16 Sep 2001, Dave Foderick wrote:

> Does anyone have a sample "hello world" python script for the web?

#! /usr/bin/python

print 'Content-type: text/html'
print
print 'Hello, world!'

> I am trying to find a sample script that I could copy up to my web site and
> find out if it is working. Is python interpreted, or do I need to compile
> and copy up to the web?

It's interpreted.

There may be other considerations however. Does your ISP support CGIs in any
directory, or just in /cgi-bin? Can it have an extension of .py, or is .cgi
the only one recognized?

-- 
Ignacio Vazquez-Abrams  <ignacio@openservices.net>