On Thu, Jan 9, 2014 at 2:30 PM, Terry Carroll <carr...@tjc.com> wrote:
> How can my Python 2.7 CGI program find the URL that caused the program to be
> called?

Hi Terry,

According to the description of CGI:

    http://en.wikipedia.org/wiki/Common_Gateway_Interface

there should be a set of environmental variables that your program can
observe to reconstruct that portion of the request string.

In particular, you should be seeing SERVER_NAME, SERVER_PORT, and
other environmental variables if CGIHTTPServer from the Python
standard library is implementing the CGI protocol.

Checking...

    http://hg.python.org/cpython/file/0e5df5b62488/Lib/CGIHTTPServer.py#l157

Yes, you should be seeing SERVER_NAME and SERVER_PORT, unless
something strange is happening.
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor

Reply via email to