|
@ -1,9 +1,19 @@ |
|
|
import datetime |
|
|
import datetime |
|
|
|
|
|
|
|
|
|
|
|
def estBissextile(date): |
|
|
|
|
|
date = date.split("-") |
|
|
|
|
|
if int(date[0])%4 == 0: |
|
|
|
|
|
return True |
|
|
|
|
|
else: |
|
|
|
|
|
return False |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def numeroJour(date): |
|
|
def numeroJour(date): |
|
|
"""renvoie un entier correspondant au numéro du jour correspondant (entre 1 et 365)""" |
|
|
"""renvoie un entier correspondant au numéro du jour correspondant (entre 1 et 365)""" |
|
|
try: |
|
|
try: |
|
|
day = datetime.datetime.strptime(date, "%Y-%m-%d") |
|
|
day = datetime.datetime.strptime(date, "%Y-%m-%d") |
|
|
|
|
|
print(estBissextile(date)) |
|
|
num_day = day.strftime('%j') |
|
|
num_day = day.strftime('%j') |
|
|
return int(num_day) |
|
|
return int(num_day) |
|
|
except(ValueError): |
|
|
except(ValueError): |
|
@ -21,4 +31,8 @@ def lecture(name): |
|
|
lst_return.append([float(pic), tuple_date]) |
|
|
lst_return.append([float(pic), tuple_date]) |
|
|
|
|
|
|
|
|
return lst_return |
|
|
return lst_return |
|
|
|
|
|
|
|
|
|
|
|
lecture("jeuTests.csv") |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|