import IPy >>>'192.168.1.100' in IPy.IP('192.168.1.0/24') is True >>>'192.168.1.0/24' in IPy.IP('192.168.0.0/16') is True >>>'192.168.1.0/24' in IPy.IP('192.168.0.0-192.168.8.255') is True
参考链接:
https://blog.csdn.net/qq_41663245/article/details/79132014