On this page
  1. ipaddress.IPv4Interface
  2. Import
  3. Signature & Overview
  4. Methods & Attributes
  5. Usage
  6. Gotchas
  7. REPL Inspect

ipaddress.IPv4Interface

Prev: ipaddress.IPv4Address | Up: ipaddress | Next: ipaddress.IPv4Network
Rel: ipaddress.AddressValueError, ipaddress.collapse_addresses, ipaddress.get_mixed_type_key, ipaddress.ip_address
Ref: docs.python.org — ipaddress.IPv4Interface
Tags: #public #python3 #stdlib #ipaddress


Import

import ipaddress
from ipaddress import IPv4Interface

Signature & Overview

ipaddress.IPv4Interface(address)

ipaddress.IPv4Interface class.

Methods & Attributes

Usage

import ipaddress

iface = ipaddress.IPv4Interface("192.168.1.10/24")
assert str(iface.ip) == "192.168.1.10"
assert str(iface.network) == "192.168.1.0/24"

Gotchas

REPL Inspect

from ipaddress import IPv4Interface
help(IPv4Interface)

Linked from

Related notes