Is there anyway to obtain client's IP address using cgi module?

Jason Orendorff jason at jorendorff.com
Wed Feb 6 16:57:04 EST 2002


J. Wang wrote:
> I am trying to create a python CGI script. [...] I'd like to log the
> user's IP address [...]

import os
os.environ['REMOTE_ADDR']

More: http://hoohoo.ncsa.uiuc.edu/cgi/env.html

## Jason Orendorff    http://www.jorendorff.com/




More information about the Python-list mailing list