61 lines
2.3 KiB
Plaintext
61 lines
2.3 KiB
Plaintext
From: bill_seitz at my-dejanews.com (bill_seitz at my-dejanews.com)
|
|
Date: Wed, 14 Apr 1999 15:47:55 GMT
|
|
Subject: stupid Win-CGI getting started question
|
|
References: <7f0f0h$pfb$1@nnrp1.dejanews.com> <8DA86302Bduncanrcpcouk@news.rmplc.co.uk>
|
|
Message-ID: <7f2db8$dev$1@nnrp1.dejanews.com>
|
|
Content-Length: 1939
|
|
X-UID: 1386
|
|
|
|
In article <8DA86302Bduncanrcpcouk at news.rmplc.co.uk>,
|
|
Duncan Booth <duncan at rcp.co.uk> wrote:
|
|
> seitz at mail.medscape.com wrote in <7f0f0h$pfb$1 at nnrp1.dejanews.com>:
|
|
>
|
|
> >...But not clear on
|
|
> >getting it configured properly to talk CGI with my WinNT Netscape Enterprise
|
|
> >server.
|
|
> >
|
|
> >How should that first #! be changed for Windows users? Could that be it?
|
|
> >
|
|
> >Could the fact that all my Python stuff is under
|
|
> >d:\program files\python\
|
|
> >be part of the problem (the long folder name with a space in it)?
|
|
>
|
|
> I tried all sorts of configuration changes to get it to run .py files
|
|
directly,
|
|
> and eventually gave it up as a bad job (mostly because I didn't want to risk
|
|
> breaking the server).
|
|
>
|
|
> The way I get CGI scripts to run with Netscape Enterprise server on NT is to
|
|
> put them in .cmd files instead of .py files. For example:
|
|
>
|
|
> ---------test.cmd----------------
|
|
> @c:\Progra~1\Python\python -x "%~f0" %* & goto :EOF
|
|
> import os
|
|
>
|
|
> print "Content-type: text/html"
|
|
> print
|
|
> print "<HTML><HEAD><TITLE>Test</TITLE></HEAD>"
|
|
> print "<body>Hello world from python.<p>"
|
|
>
|
|
> for k in os.environ.keys():
|
|
> print k, os.environ[k], "<br>"
|
|
> print "</body>"
|
|
> ---------end of test.cmd---------
|
|
> You would need to change the path to reflect the location of your copy of
|
|
> Python, either use the 8.3 filename as above, or put the filename in quotes:
|
|
> @"c:\Program Files\Python\python" -x "%~f0" %* & goto :EOF
|
|
> works.
|
|
|
|
I tried your test.cmd (after changing the first line, using your quoted path
|
|
and making it my path of course). Now I get a response back of internal or
|
|
external command, operable program or batch file. The server acts shows this
|
|
as a successful delivery (no error in the logs, status=200). Does that mean
|
|
the problem is now within Python?
|
|
|
|
-----------== Posted via Deja News, The Discussion Network ==----------
|
|
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
|
|
|
|
|
|
|
|
|