ID EN
Socket

inet_ntoa

Python 3.11

Convert a 32-bit packed IPv4 address (a bytes-like object four bytes in length) to its standard dotted-quad string representation (for example, ‘123.45.67.89’). This is useful when conversing with a program that uses the standard C library and needs objects of type in_addr, which is the C type for the 32-bit packed binary data this function takes as an argument.

Syntax

PYTHON
socket.inet_ntoa(packed_ip)

See Also

bytes-like object OSError inet_ntoa() inet_ntop() bytes-like object