ipaddress — IPv4/IPv6 操纵库

源代码: Lib/ipaddress.py


ipaddress 提供创建、操纵及运转于 IPv4/IPv6 地址和网络的能力。

The functions and classes in this module make it straightforward to handle various tasks related to IP addresses, including checking whether or not two hosts are on the same subnet, iterating over all hosts in a particular subnet, checking whether or not a string represents a valid IP address or network definition, and so on.

这是完整的模块 API 参考 — 对于概述和介绍,见 ipaddress 模块介绍 .

Added in version 3.3.