上代码:
import csv
f = open("C:/Users/Administrator/Desktop/11.txt",'r')
with f:
reader = csv.reader(f,delimiter=",")
for row in reader:
for e in row:
print(e)
实现效果如下:
G:\Python3.8解释器\python.exe C:/Users/Administrator/PycharmProjects/pythonProject/11.py
192.168.1.1
192.168.3.1
192.168.33.2
172.1.2.22
178.3.21.124
168.131.35.11
168.131.35.12
168.131.35.13
168.131.35.14
168.131.35.15
Process finished with exit code 0
标签:Administrator,python,131.35,-------------------------------------,reader,csv,row From: https://www.cnblogs.com/cherishthepresent/p/17628443.html