我希望能够从 txt
文件中处理IP地址列表,然后确认它们是否可访问或响应Excel文件中的IP地址。
我已经看到了以下内容,我用作基础,但似乎并没有像我期望的那样起作用。
我要去某个地方;
import re
import csv
f = open('C:/Users/dir/dir/iplogs.txt', 'r') #Text file with many ip address
o = f.read()
ip1 = re.findall( r"\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}", o )
hosts = ip1
for host in hosts:
但是,那我就无法完全弄清楚如何从这里进行管理。
I would like to be able to python script to process a list of IP addresses from a txt
file and then confirm whether they are accessible or responding IP Addresses within a excel file.
I have seen the following, which I have used as a base but it doesn't seem to work or work as I would expect;
https://www.geeksforgeeks.org/extract-ip-address-from-file-using-python/
I was going somewhere along the lines of;
import re
import csv
f = open('C:/Users/dir/dir/iplogs.txt', 'r') #Text file with many ip address
o = f.read()
ip1 = re.findall( r"\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}", o )
hosts = ip1
for host in hosts:
However then I couldn't quite figure out how to manage this from here.
发布评论