Created
March 22, 2013 09:34
-
-
Save amxku/5220044 to your computer and use it in GitHub Desktop.
checkIpNslookup
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
def checkIpName(arg): | |
cmd = 'nslookup %s' % arg.strip() | |
handle = Popen(cmd, stdout = PIPE, stderr = PIPE, shell = True).stdout | |
re_handle = handle.read() | |
handle.close() | |
# name 关键词 | |
botkey = ['baidu','google','yahoo','msn'] | |
if re.search('Name',re_handle): | |
for bk in botkey: | |
checkkey = re.search(bk,re_handle) | |
if checkkey: | |
print "%s-%s\n" % (arg.strip(),bk) | |
break |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment