errort 当前离线
列兵
f = open('mac.log').readlines() for line in f: mac = line.split('ether ')[1].strip('\n').strip(' ')复制代码
brim 当前离线
三级士官
#encoding=utf-8 import re with open('20200922MAC.txt','r') as fp: txtinfo = ''.join(fp.readlines()) mac = re.findall(r'(?:[0-9a-fA-F]{2}:){5}(?:[0-9a-fA-F]{2})',txtinfo) print('\n'.join(mac))复制代码
TOP