- 用法:- ipaddress.summarize_address_range(first, last)
- 返回給定第一個和最後一個 IP 地址的匯總網絡範圍的迭代器。 - first是該範圍內的第一個- IPv4Address或- IPv6Address,而- last是該範圍內的最後一個- IPv4Address或- IPv6Address。如果- first或- last不是 IP 地址或版本不同,則會引發- TypeError。如果- last不大於- first或- first地址版本不是 4 或 6,則會引發- ValueError。- >>> [ipaddr for ipaddr in ipaddress.summarize_address_range( ... ipaddress.IPv4Address('192.0.2.0'), ... ipaddress.IPv4Address('192.0.2.130'))] [IPv4Network('192.0.2.0/25'), IPv4Network('192.0.2.128/31'), IPv4Network('192.0.2.130/32')]
相關用法
- Python ipaddress.collapse_addresses用法及代碼示例
- Python ipaddress.IPv4Address.reverse_pointer用法及代碼示例
- Python ipaddress.IPv4Address.__format__用法及代碼示例
- Python ipaddress.IPv4Network.supernet用法及代碼示例
- Python ipaddress.IPv4Network.supernet_of用法及代碼示例
- Python ipaddress.IPv4Network.address_exclude用法及代碼示例
- Python ipaddress.IPv4Interface.ip用法及代碼示例
- Python ipaddress.IPv4Network.subnets用法及代碼示例
- Python ipaddress.IPv4Interface.with_prefixlen用法及代碼示例
- Python ipaddress.IPv4Interface.with_netmask用法及代碼示例
- Python ipaddress.v4_int_to_packed用法及代碼示例
- Python ipaddress.IPv4Interface.with_hostmask用法及代碼示例
- Python ipaddress.IPv4Network.subnet_of用法及代碼示例
- Python ipaddress.IPv4Address用法及代碼示例
- Python ipaddress.IPv6Address用法及代碼示例
- Python ipaddress.IPv4Network.compare_networks用法及代碼示例
- Python ipaddress.IPv4Network.hosts用法及代碼示例
- Python ipaddress.IPv4Interface.network用法及代碼示例
- Python ipaddress.ip_address用法及代碼示例
- Python numpy ipmt用法及代碼示例
注:本文由純淨天空篩選整理自python.org大神的英文原創作品 ipaddress.summarize_address_range。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。
