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

About this user

« Newer Snippets
Older Snippets »
Showing 1-1 of 1 total  RSS 

Python - My External IP Address

// My external ip address

   1  
   2  import urllib
   3  
   4  url = urllib.URLopener()
   5  resp = url.open('http://myip.dk')
   6  html = resp.read(114)
   7  
   8  end = html.find("</title>")
   9  start = html.find("IP:") + 3
  10  
  11  print html[start:end].strip()
« Newer Snippets
Older Snippets »
Showing 1-1 of 1 total  RSS