Is there a function of ipaddress to get the subnet only from input like 192.168.1.129/25

Daniel Flick daniel.p.flick at gmail.com
Tue Oct 17 12:59:21 EDT 2017


I am very new to Python and have been struggling to find some info on processing IP addresses.

get_network returns 192.168.1.128/25 but I need 192.168.1.128 only.  I can do this with netaddr but I am working with Mako templates and ipaddress is a built in module so there are less dependencies.

Any ideas?



More information about the Python-list mailing list