1 changed files with 24 additions and 0 deletions
@ -0,0 +1,24 @@ |
|||||
|
|
||||
|
def lecture(name): |
||||
|
"Ouvre le fichier csv et renvoie un tableau" |
||||
|
lst_date = [] |
||||
|
lst_pic = [] |
||||
|
lst_temp_moy = [] |
||||
|
lst_temp_ref = [] |
||||
|
lst_données = [] |
||||
|
with open(name) as fic: |
||||
|
fic.readline() |
||||
|
for ligne in fic: |
||||
|
date, pic, temp_moy, temp_ref = ligne.split(',') |
||||
|
lst_date.append(str(date)) |
||||
|
lst_pic.append(float(pic)) |
||||
|
lst_temp_moy.append(float(temp_moy)) |
||||
|
lst_temp_ref.append(float(temp_ref)) |
||||
|
lst_données.append(lst_date) |
||||
|
lst_données.append(lst_pic) |
||||
|
lst_données.append(lst_temp_moy) |
||||
|
lst_données.append(lst_temp_ref) |
||||
|
return lst_données |
||||
|
|
||||
|
|
||||
|
print(lecture("jeuTests.csv")) |
Loading…
Reference in new issue