python CSV文件读取

import csv

with open('vm3.csv','r',encoding='utf-8') as f:

        reader = csv.DictReader(f,dialect='excel')

        for row in reader:

                    print(row['name'])

                    print(row['ip'])

你可能感兴趣的:(python CSV文件读取)