Manipulating IP addresses

Often, you will need to manipulate IP addresses and perform some sort of operations on them. Python 3 has a built-in ipaddress module to help you carry out this task. It has convenient functions for defining the IP addresses and the IP networks, and for finding lots of useful information. For example, if you would like to know how many IP addresses exist in a given subnet, for instance, 10.0.1.0/255.255.255.0 or 10.0.1.0/24, you can find them with the help of the following command.

This module will provide several classes and factory functions for working with both IPv4 and IPv6 versions.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset