一个简单的"if"语句就足够了.请参阅控制流文档.
import csv with open('Cars.csv') as csvfile: reader = csv.DictReader(csvfile) for row in reader: if row['Colour'] == 'blue': print(row['ID'] ,row ['Make'],row ['Colour'])