1
2
3
4
5
6
7
#!/usr/bin/env python
#-*- encoding: utf-8 -*-

import re
import urllib2

print "public IP address is: " + re.search('d+.d+.d+.d+',urllib2.urlopen("http://www.whereismyip.com").read()).group(0)