Created
October 9, 2012 19:48
-
-
Save geekgonecrazy/3861005 to your computer and use it in GitHub Desktop.
IP extract
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/python | |
################################### | |
#Author: Aaron Ogle # | |
#Function: Extract ips from list.# | |
################################### | |
import sys | |
if len(sys.argv) > 1: | |
try: | |
file_ips = open(sys.argv[1], "r") | |
except IOError: | |
print "File not found" | |
else: | |
for line in file_ips: | |
ip = line.split(':') | |
print ip[0] | |
else: | |
print "No file path specified. \nUsage: python ipextract.py filename" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment