标签:blog http os for sp on 2014 log bs
import socket
localip=socket.gethostbyname(socket.gethostname())
print (localip)
iplist=socket.gethostbyname_ex(socket.gethostname())
for i in iplist:
if i !=localip:
print ("external IP:%s"%i)
print(socket.gethostname())
如图:
标签:blog http os for sp on 2014 log bs
原文地址:http://www.cnblogs.com/mhxy13867806343/p/4058377.html