Update template.py

This commit is contained in:
augustin64 2023-12-10 15:24:38 +01:00
parent 689eb31357
commit 5cd143fcb5

View File

@ -2,10 +2,12 @@
"""
Jour DAY du défi Advent Of Code pour l'année YEAR
"""
import os
def read_sample():
"""récupère les entrées depuis le fichier texte correspondant"""
with open('inputs/dayDAY.txt', 'r') as f:
filename = os.path.join(os.path.dirname(__file__ ), "inputs", "dayDAY.txt")
with open(filename, 'r') as f:
sample = f.read().split('\n')
sample = [ i for i in sample if i != '' ]
return sample