If you just want to display text on a webpage from a Python script, a simple way to print to a web page is shown in the script below:
#!/usr/bin/python print "Content-type: text/plain\n" print "Hello world"
If you want to display HTML code, you can use Python code like the following:
#!/usr/bin/python print "Content-type: text/html" print print """<!DOCTYPE HTML> <html lang="en"> <body> <h1>Hello World!</h1> </body> </html> """
[ More Info ]