CGI Scripts

Anders M Eriksson anders.eriksson at morateknikutveckling.se
Thu Feb 10 04:45:27 EST 2000


On Sun, 06 Feb 2000 01:11:40 GMT, "Robert Rutkowski"
<bobNOSPAM at NOSPAMzippyhelp.com> wrote:

>My problem is that the script returns a result via the print command. {print
>`count()`}, but when I try to run the script on my server, I get no results,
>just a blank page.
>Am I missing something? Is there a module that I need to pass the result to
>to see it in my web browser.

First I would add two 'debug' lines to the script

sys.stderr = sys.stdout
print "Content-Type: text/plain\n"

If anything is wrong then you will see it in the browser!

Then I also would add some more text so I could see if the print out
of the count() is wrong or if it's something else.

One thing I have noticed is that if I get an error/exception in the
script then I get somekind of default blank HTML-page.


#<snip the count() >

sys.stderr = sys.stdout
print "Content-Type: text/plain\n"

print "Hello World"
print `count()`


Hope this helps a bit

// Anders
-- 
English isn't my first or second language, 
so errors or anything that you find offending is not there on 
purpose it's just due to the translation.



More information about the Python-list mailing list