一、CSV文件有两列时,以左列为key,右列为value。 有如下的test.csv文件,和py文件放置于同一目录下: name,age bob,12 tom,14 with open('test.csv') as f: dict = {} reader = csv.DictReader(f) for row in reader: dict[row['name']]=row['information'] print dict['bob'] 就会输出12。