Getting HTTP info

Richard Chamberlain richard_chamberlain at ntlworld.com
Fri Aug 4 19:19:30 EDT 2000


jidun at my-deja.com wrote:
> 
> Hey,
> I have a python script running. Everything is all kosher, but I would
> like to get the IP (and other HTTP information) from the client
> retrieving my page.
> 
> What to do?
> 
> Thanks!
> 
> Sent via Deja.com http://www.deja.com/
> Before you buy.
Hi,

There stored in enviroment variables,

so something like 

import cgi
print cgi.os.environ['REMOTE_ADDR']

should get you the ip address.

There are a obviously other variables in there so you'll need to
experiment.

Richard



More information about the Python-list mailing list