On this page
  1. socket.inet_ntoa
  2. Import
  3. Signature & Overview
  4. Usage
  5. Gotchas
  6. REPL Inspect

socket.inet_ntoa

Prev: socket.inet_aton | Up: socket | Next: socket.inet_ntop
Rel: socket.AddressFamily, socket.close, socket.create_connection, socket.create_server
Ref: docs.python.org — socket.inet_ntoa
Tags: #public #python3 #stdlib #socket


Import

import socket
from socket import inet_ntoa

Signature & Overview

socket.inet_ntoa(packed_ip, /)

Convert an IP address from 32-bit packed binary format to string format.

Usage

import socket

assert socket.inet_ntoa(b"\x7f\x00\x00\x01") == "127.0.0.1"

Gotchas

REPL Inspect

from socket import inet_ntoa
help(inet_ntoa)

Linked from

Related notes