DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world
Python CGI Script To Display Client's IP Address
When run as a cgi script, this will print the client's IP address.
import cgi import os print "Content-type: text/html" print "" print cgi.escape(os.environ["REMOTE_ADDR"])