1
xavierskip 2014-11-06 14:34:42 +08:00
|
2
gangsta 2014-11-06 14:41:22 +08:00
sof上看到一个很hackish的写法:
import socket s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM); s.connect(('8.8.8.8', 80)); print(s.getsockname()[0]); s.close(); |
4
caiych 2014-11-06 15:51:13 +08:00
import urllib2
urllib2.urlopen('http://ifconfig.co/all.json').read() |