ID EN
Socket

inet_ntop

Python 3.11

Convert a packed IP address (a bytes-like object of some number of bytes) to its standard, family-specific string representation (for example, '7.10.0.5' or '5aef:2b::8'). inet_ntop() is useful when a library or network protocol returns an object of type in_addr (similar to inet_ntoa()) or in6_addr.

Syntax

PYTHON
socket.inet_ntop(address_family, packed_ip)

See Also

bytes-like object inet_ntop() inet_ntoa() AF_INET AF_INET6 ValueError OSError inet_ntop()