Created
December 18, 2016 00:14
-
-
Save David-5-1/815dc613c0618a6416557551865089c5 to your computer and use it in GitHub Desktop.
This file contains 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
#!/usr/bin/python3 | |
# WTFPL http://www.wtfpl.net/txt/copying/ | |
import ipaddress | |
import sys | |
for range_ in sys.argv[1:]: | |
try: | |
print(*ipaddress.ip_network(range_, strict=False).hosts(), sep='\n') | |
except ValueError: | |
print("{range_} is not a valid IP range".format(range_=range_)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment