On Wed, 08 Jul 2009 12:29:54 +0200, Piet van Oostrum <p...@cs.uu.nl>
wrote:

>Something like:
>
>#! /usr/bin/env python
>
>import cgi
>from os import getenv
>
>print "Content-type: text/html"
>print
>
>ipaddr = (getenv("HTTP_CLIENT_IP") or
>      getenv("HTTP_X_FORWARDED_FOR") or
>      getenv("HTTP_X_FORWARDED_FOR") or
>      getenv("REMOTE_ADDR") or
>      "UNKNOWN")
>
>print ipaddr

That did it.  

I wonder why they don't just have a function to return it instead of
putting you through all of that?  

At any rate, it works.  

Regards, 




                                                      Fred 
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to