USE: $ python myip.py <------------- Copy here -------------> #!/usr/bin/python # -*- coding: utf-8 -*- def IP(): from urllib2 import urlopen from re import findall lists = [ "http://www.get-ip.me/", "http://checkip.dyndns.org/", "http://whatsmyip.net/", "http://mxtoolbox.com/WhatIsMyIP/", ] for x in lists: try: data = urlopen(x, timeout=2).read() grab = findall('([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+)', data) ip = grab[0] break except: pass...