getting clients ip address

Chris Liechti cliechti at
Sat Sep 7 16:32:57 EDT 2002

"Leader" <leader730 at> wrote in
news:r0te9.25654$6W3.867995 at 

> Hello, I am using Python for my website, more specifically
> Spyce+mod_python, what I want to do is print out the clients ip
> address on the site so it can say something like "your ip
>" basicly the python version of <?php echo
> getenv("REMOTE_ADDR"); ?> I'm sure I saw something a while ago while
> browsing through the module docs but I can't find it anymore.

something like:

>>> import os
>>> print os.environ["REMOTE_ADDR"]


Chris <cliechti at>

More information about the Python-list mailing list