stuck on first example!

Steve Holden sholden at holdenweb.com
Mon Feb 11 18:27:43 EST 2002


"Flavian Hardcastle" <deathtospam43423 at altavista.com> wrote in message
news:Xns91B3637BF6C59AusYourStandingInIt at 210.49.20.254...
> The example at http://www.devshed.com/Server_Side/Python/CGI/page3.html is
> supposed to produce the text in my browser "Hello, Python", but it doesn't
> do a thing.
>
> Instead, using the Xitami personal server, I get the error
>
> >Internal error: your request was unsuccessful
> >Cannot create CGI process - program not found
>
> Here is the text of the example...
>
> #!/usr/bin/python
>
> # Tell the browser how to render the text
> print "Content-Type: text/plain\n\n"
>
> print "Hello, Python!"  # print a test string
>
>
> I had a theory that the first line was the problem. The tut says that it's
> used by Unix and Linux servers to tell the OS to initiate Python. I'm
using
> Win98, btw. I tried changing it to the following......
>
> >#path = c:/Python22/Python.exe
>
> and then directing to the file location on my HD ...
>
> >#path = d:/Docs/Web/cgi-bin/index.py
>
> ... but in both cases the browser merely gave me the option of downloading
> the file, or opening it using Python.
>
> So what am I missing?

If you're using Xitami then the problem almost certainly is your first line.
On Windows you aren't likely to find /usr/bin/python without a stretch of
the imagination.

On Win98 my Xitami CGI scripts all start with

#! C:/Python20/python

This is the classic "shebang" line trick: the "#!" announces to the
execution environment that the containing file should be processed by the
named interpreter. Although Windows in general knows nothing of shebang,
Xitami is prepared to go the extra mile. So I'm guessing if you use

#! C:/Python22/python

all will be well. Xitami's a great little server (with a big heart). Enjoy!

regards
 Steve
--
Consulting, training, speaking: http://www.holdenweb.com/
Author, Python Web Programming: http://pydish.holdenweb.com/pwp/

"This is Python.  We don't care much about theory, except where it
intersects with useful practice."  Aahz Maruch on c.l.py







More information about the Python-list mailing list