标签:read iter long pre target bin mat imp format
#!/usr/bin/python
import csv
NewSN = ""
# find good SN 给出MAC,寻找对应的SN
with open("DIGI_MAC_28_5_2021_40units.csv", newline=‘‘) as csvfile:
csv_reader = csv.reader(csvfile, delimiter=‘,‘, quotechar=‘|‘)
for row in csv_reader:
SN,MAC = row
if MAC == target:
NewSN = SN
csvfile.close()
#print(NewSN)
long_info = ""
file_line_last = file_line_last.strip(‘\n‘)
#long_info= file_line_last + NewSN
long_info = ‘{}{}‘.format(file_line_last, NewSN)
print(long_info)
标签:read iter long pre target bin mat imp format
原文地址:https://www.cnblogs.com/wang-xiao-shuai/p/14925353.html