netaddr value back to IP

Michael Ströder michael at stroeder.com
Fri Nov 14 10:03:40 CET 2014


Noah wrote:
> I am trying to get a value back to IP using the netaddr python module.
> How do I get the value 'ip' back to IP format?  how is it done?
> 
> ---- snip ----
> 
>     print IPNetwork(v4_peer_ip).value
>     ip = IPNetwork(v4_peer_ip).value + 1
>     print ip
> 
> --- snip ---

>>> ip=netaddr.IPAddress('192.168.71.20')
>>> ip+=1
>>> str(ip)
'192.168.71.21'

Ciao, Michael.




More information about the Python-list mailing list