如何在Python中从2个IP地址计算网络掩码
如果我有某个范围内的第一个和最后一个 ip 地址,如何在 Python 中计算子网掩码?
我希望网络掩码为例如 255.255.255.0。
谢谢 ;)
How can I calculate the subnetmask in Python if I have the first and the last ip adresses in a range?
I want the netmask as e.g. 255.255.255.0.
Thanks ;)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
假设我们有...
那么您可以让表示进行一些异或运算。例如。
所以:
Say that we have...
Then you can have the representation doing a few XORs. Eg.
So: