CGI Scripts

Robert Rutkowski bobNOSPAM at NOSPAMzippyhelp.com
Tue Feb 8 04:07:54 CET 2000


Is it possible the server does not have the cgi or string modules installed?
How would I find out what is there?

"Robert Rutkowski" <bobNOSPAM at NOSPAMzippyhelp.com> wrote in message
news:gT3n4.4938$563.203215 at newsread1.prod.itd.earthlink.net...
> I'm new to programing and in an effort to learn python, I'm trying to
write
> a simple text counter. The script is called with an SSI exec command. The
> path on my server is correct and the script appears to work. I receive no
> errors, and the script runs just fine locally on my machine.
> 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.
>
> -----------------------------------------------------
> #!/usr/contrib/bin/python
>
> #Python Counter Script
>
> import cgi
> import string
>
> def count():
>     count = open('counter.log', 'r+')
>     strhits = count.read()
>     hits = string.atoi(strhits)
>     hits = hits+1
>     count.seek(0, 0)
>     count.write(`hits`)
>     count.close()
>     return hits
>
> print "Content-type: text/html"
> print
> print `count()`
> ------------------------------------------------
>
>





More information about the Python-list mailing list