CGI Scripts

Robert Rutkowski bobNOSPAM at
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> wrote in message
news:gT3n4.4938$563.203215 at
> I'm new to programing and in an effort to learn python, I'm trying to
> 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.
> `count()`}, but when I try to run the script on my server, I get no
> just a blank page.
> Am I missing something? Is there a module that I need to pass the result
> 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 =
>     hits = string.atoi(strhits)
>     hits = hits+1
>, 0)
>     count.write(`hits`)
>     count.close()
>     return hits
> print "Content-type: text/html"
> print
> print `count()`
> ------------------------------------------------

More information about the Python-list mailing list