Monday, August 23, 2021

Python ipaddress module

I'm using the ipaddress module in Python to work with IPs. I can get a list of all of the usable hosts with:

addr4.hosts

and I can get the subnet address and broadcast address with:

addr4.broadcast_address

addr4.network_address

I'm just wondering if there is a simple way to get the full list of ips including broadcast and network address with one call?

Has anybody done something similar?

Thanks



No comments:

Post a Comment