Never been to DZone Snippets before?

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 (See related posts)

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"])

You need to create an account or log in to post comments to this site.


Click here to browse all 4861 code snippets

Related Posts