In this section, you will learn how to retrieve the network configuration with the netifaces package, and understand the standard Python libraries for IP address manipulation.
Retrieving the network configuration of a local machine
Gathering information with the netifaces package
Now, we are going to discover some more information about the network interface and the gateway machine of your network.
In every LAN, a host is configured to act as a gateway, which talks to the outside world. To find the network address and the netmask, we can use a Python third-party library, netifaces. For example, you can call netifaces.gateways() to find the gateways that are configured to the outside world. Similarly, you can enumerate the...