标签:登录 操作 print tran over z-index point pass 命令
# -*- coding: utf-8 -*-
# Aduthor:CCIP-Ma
import os
import re
import sys
#print(os.listdir(r‘E:\filetest‘))
import_ip= input(‘查询的ip地址:‘)
def checkip(hostip):
pat = re.compile(r‘([0-9]{1,3})\.‘)
r = re.findall(pat,hostip+".")
if len(r)==4 and len([x for x in r if int(x)>=0 and int(x)<=255])==4:
pass
else:
print("错误")
sys.exit()
checkip(import_ip)
path=r‘E:\a‘#配置存放文件目录
def FindIp(ip):#查询ip
for file in os.listdir(path):
f_path=path+"\\"+file
#print(f_path)
f=open(f_path,‘r‘,encoding=‘utf-8‘)
for line in f:
if ip in line:
print(‘‘‘-----------info---------
策略:%s
节点名称:%s
‘‘‘%(line,file))
else:
pass
print(‘没有该%s地址的策略‘%ip)
FindIp(import_ip)
x
# -*- coding: utf-8 -*-
# Aduthor:CCIP-Ma
import os
import re
import sys
#print(os.listdir(r‘E:\filetest‘))
import_ip= input(‘查询的ip地址:‘)
def checkip(hostip):
pat = re.compile(r‘([0-9]{1,3})\.‘)
r = re.findall(pat,hostip+".")
if len(r)==4 and len([x for x in r if int(x)>=0 and int(x)<=255])==4:
pass
else:
print("错误")
sys.exit()
checkip(import_ip)
path=r‘E:\a‘#配置存放文件目录
def FindIp(ip):#查询ip
for file in os.listdir(path):
f_path=path+"\\"+file
#print(f_path)
f=open(f_path,‘r‘,encoding=‘utf-8‘)
for line in f:
if ip in line:
print(‘‘‘-----------info---------
策略:%s
节点名称:%s
‘‘‘%(line,file))
else:
pass
print(‘没有该%s地址的策略‘%ip)
FindIp(import_ip)
标签:登录 操作 print tran over z-index point pass 命令
原文地址:https://www.cnblogs.com/ccip-ma/p/188c4cb99e589563c6b73a2847434d23.html