2019-2020/Formations/NSI/Bloc1/diubloc1-files-td6/ex_csvlib.py
2020-05-05 09:53:14 +02:00

10 lines
265 B
Python

# cf https://docs.python.org/fr/3/library/csv.html
import csv
fieldnames = ['x', 'y']
with open('donnees-2-colonnes.csv', newline='') as csvfile:
reader = csv.DictReader(csvfile, fieldnames=fieldnames)
for row in reader:
print(row['x'], row['y'])