Hi Folks,

 

I’m getting the following error from my web server (httpd on linux): “malformed header from script. Bad header=<html>: htmllib.cgi

 

The script I’m running is a Python script as follows:

 

#!/usr/bin/python

 

def openDocument( ):

            print """<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\">""";

 

def openHTML( ):

            print "<html>";

           

def closeHTML( ):

            print "</html>";

           

def openHead( ):

            print """<head>\n\t<meta HTTP-EQUIV=\"CONTENT-TYPE\" CONTENT=\"text/html; charset=utf-8\">""";

 

def closeHead( ):

            print "</head>";

           

def openBody( ):

            print "<body>"

           

def closeBody( ):

            print "</body>";

           

def title(string=""):

            print "\t<title>%s</title>" % string;

           

def p(string="", align="left", fontSize=3):

            print "<p align=%s><font size=%d>\n%s\n</font></p>" % (align, fontSize, string);

 

def br( ):

            print "<br>";

 

 

if(__name__ == "__main__"):

           

            #openDocument();

            openHTML();

            #openHead();

            #title("Test Page");

            #closeHead();

 

            openBody();

 

            p("this is a test. this is a test. this is a test. this is a test. this is a test. this is a test. this is a test. this is a test. this is a test. this is a test.", "center", 4);

 

            closeBody();

 

            closeHTML();

           

It gives the same complaint if I’ve got openDocument and/or openHead uncommented. The script is executing otherwise the error wouldn’t show up in the error_log with specific text from the script. Also, I’ve run the script and redirected it’s output to an .html file and the server loads it with no problems.

 

Any ideas are appreciated.

 

Thanks,

 

Ron Griswold

Character TD

R!OT Pictures

[EMAIL PROTECTED]

 

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to