[Tutor] How do you simulate a CGI script locally?

Sean 'Shaleh' Perry shalehperry@attbi.com
Fri Dec 13 02:21:02 2002


On Thursday 12 December 2002 23:08, Alfred Milgrom wrote:
> I guess this is a pretty stupid question, but I haven't been able to fi=
nd
> the answer anywhere.
>
> I want to develop a CGI script, and I'd like to test it locally (I mean=
 on
> my own computer, running Windows), rather than uploading the file to th=
e
> server, testing it, revising it, and so on.
>
> My question is: how do I make my Python program behave like a CGI scrip=
t,
> where print statements end up shown in the browser window. If I point m=
y
> browser at my CGI test file, it runs, but the output goes to the DOS bo=
x
> instead.
>

a) install a web server on your local machine

b) in the end a cgi is simply a program which gets some input and prints =
some=20
output.  You can test these programs from the command line, especially ea=
sy=20
if you install the cygwin tools.