ID EN
Socket

inet_aton

Python 3.11

Convert an IPv4 address from dotted-quad string format (for example, ‘123.45.67.89’) to 32-bit packed binary format, as a bytes object four characters in length. 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 this function returns.

Syntax

PYTHON
socket.inet_aton(ip_string)

See Also

inet_aton() OSError inet_aton() inet_pton()