import csv file = 'D:\\1.csv' with open(file, encoding="UTF8") as f: reader = csv.reader(f) # 创建 读取器 header_row = next(reader) # 获取表的第一行(一般是列名) print(header_row) # 打印 first_row = next(reader) # 获取标的第二行 print(first_row)
标签:读取,cvs,一行,header,file,reader,csv,row From: https://www.cnblogs.com/yingpu/p/17796075.html