Created
January 15, 2017 01:25
-
-
Save petrosagg/ecb5948110ff96d1be7b1e96bc63dcb5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import ipaddress | |
| ip = '192.168.1.54' | |
| netmask = '255.255.255.0' | |
| network = ipaddress.IPv4Network((ip, netmask), strict=False) | |
| print(str(network)) # prints 192.168.1.0/24 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment