python web programming for PHP programmers

D'Arcy J.M. Cain darcy at druid.net
Wed Dec 24 11:44:45 EST 2008


On Wed, 24 Dec 2008 14:40:31 +0000 (UTC)
Nikola Skoric <nick-news at net4u.hr> wrote:
> a general python tutorial, I just need a tutorial on how to make a
> hello world server side script with python. Any suggestions?

#! /usr/bin/env python

import sys, re

colour = re.sub('=', '=#', ''.join(sys.argv[1:]))

print """Content-type: text/html

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <HTML>

    <HEAD>
        <TITLE>Hello World</TITLE>
        <LINK REV="MADE" HREF="mailto:darcy at druid.net">
        <META HTTP-EQUIV="Content-Type" CONTENT="text/html;
CHARSET=utf-8"> </HEAD>

    <BODY %s>
    <H1>Hello World</H1>""" % colour

print """<P>
    Hello World
    </BODY></HTML>"""

-- 
D'Arcy J.M. Cain <darcy at druid.net>         |  Democracy is three wolves
http://www.druid.net/darcy/                |  and a sheep voting on
+1 416 425 1212     (DoD#0082)    (eNTP)   |  what's for dinner.



More information about the Python-list mailing list