Re: Problems with running Python CGI Scripts

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Gabriel Genellina

    Re: Problems with running Python CGI Scripts

    En Wed, 03 Sep 2008 05:29:39 -0300, Edward FISHER <edward.fisher@ st.com>
    escribi�:
    I can get the script to run the python script but all that happens is
    that the black python box appears then disapears, the html that the
    python scripts should generate is never output.
    [...]
    This is calling the pyc file of the python script. I dont understand why
    if i call the py file itself all i get returned is the plain text of the
    python file.
    That's a server setting (Apache or whatever) - make sure it is configured
    to *execute* the script.
    The python script is:
    >
    #!/usr/local/bin/python
    import cgi
    >
    def main():
    print "Content-type: text/html\n"
    I hope this is just the way you posted your message, but remember that in
    Python indentation is important. The above code isn't valid. Once you are
    sure that your script doesn't have syntax errors, add this lines on the
    top to help debugging:

    import cgitb; cgitb.enable()

    --
    Gabriel Genellina

Working...