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

ipaddress.v4_int_to_packed

Prev: ipaddress.summarize_address_range | Up: ipaddress | Next: ipaddress.v6_int_to_packed
Rel: ipaddress.AddressValueError, ipaddress.collapse_addresses, ipaddress.get_mixed_type_key, ipaddress.ip_address
Ref: docs.python.org — ipaddress.v4_int_to_packed
Tags: #public #python3 #stdlib #ipaddress


Import

import ipaddress
from ipaddress import v4_int_to_packed

Signature & Overview

ipaddress.v4_int_to_packed(address)

Represent an address as 4 packed bytes in network (big-endian) order.

Usage

import ipaddress

assert ipaddress.v4_int_to_packed(0x7F000001) == b"\x7f\x00\x00\x01"

Gotchas

REPL Inspect

from ipaddress import v4_int_to_packed
help(v4_int_to_packed)

Linked from

Related notes