PyDocs

Nav

Internet Protocols and Support

IPv6Address.__format__

ipaddress

method of IPv6Address · Added in 3.9 (source)
  • IPv6Address.__format__(fmt)
Returns an IP address as a formatted string.

Supported presentation types are:
's': returns the IP address as a string (default)
'b': converts to binary and returns a zero-padded string
'X' or 'x': converts to upper- or lower-case hex and returns a zero-padded string
'n': the same as 'b' for IPv4 and 'x' for IPv6

For binary and hex presentation types, the alternate form specifier
'#' and the grouping option '_' are supported.
0 Examples
No examples for ipaddress/IPv6Address.__format__.
See Also
No see-alsos for ipaddress/IPv6Address.__format__
0 Notes
No notes for IPv6Address.__format__