Getting ip address and browser info

Steven Adams adams_s at lab.eng.usyd.edu.au
Sun Jul 9 17:59:44 EDT 2000


heres a snippet I've found that prints out server details:

import os
for x,y in os.environ.items():
    print x, y


------------------

os.environ['HTTP_USER_AGENT'] gives browser type
os.environ['REMOTE_ADDR'] gives the IP address of the requesting party

-----------

hope that helps,

Steven

Curtis Jensen <cjensen at bioeng.ucsd.edu> wrote in message
news:3967B9F8.1694E2F3 at bioeng.ucsd.edu...
> Using python CGI how can I get the ip address and browser info of the
> requestion party?  Thanks.
>
> --
> Curtis Jensen
> cjensen at bioeng.ucsd.edu
> http://www-bioeng.ucsd.edu/~cjensen/
> FAX (425) 740-1451





More information about the Python-list mailing list