首页| JavaScript| HTML/CSS| Matlab| PHP| Python| Java| C/C++/VC++| C#| ASP| 其他|
购买积分 购买会员 激活码充值

您现在的位置是:虫虫源码 > Python > 获取本地IP信息,用纯Python

获取本地IP信息,用纯Python

  • 资源大小:8.50 kB
  • 上传时间:2021-06-29
  • 下载次数:0次
  • 浏览次数:0次
  • 资源积分:1积分
  • 标      签: python IP 信息 获取 本地

资 源 简 介

class MyIpInfo--Get local ip information class IpAddress--ip address class IpNetwork--ip network example: m = MyIpInfo( ) print "hostname", m.hostname print "my ip list", m.iplist print "local ip", m.localip print "has inet", m.has_inet print "inet ip", m.inetip print "---------------" ipstr = "192.168.0.3" ip = IpAddress(ipstr) print ip print "is_lan_ip=", ip.is_lan_ip() print "within network", ipstr+"/255", ip.within(ipstr+"/255") n = IpNetwork("192.168.0.1", "255.255.255.0") n = IpNetwork("192.168.0.1/255") print "IpNetwork", n print "has",ipstr,"=",n.has(ipstr)
VIP VIP
0.179159s