from IPy import IP
ip = '19.18.0.66/24'
addr_list = ip.split('/')
addr = IP(addr_list[0]).make_net(addr_list[-1])
terminal_ip = '19.18.0.222'
if terminal_ip in addr:
print('in')
from IPy import IP
ip = '19.18.0.66/24'
addr_list = ip.split('/')
addr = IP(addr_list[0]).make_net(addr_list[-1])
terminal_ip = '19.18.0.222'
if terminal_ip in addr:
print('in')
本文标题:判断不规则ip掩码字符串是否在某个地址段
本文链接:https://www.haomeiwen.com/subject/syhqmrtx.html
网友评论