From 5cd143fcb5eefcb68b383508754c336c333acb8b Mon Sep 17 00:00:00 2001 From: augustin64 Date: Sun, 10 Dec 2023 15:24:38 +0100 Subject: [PATCH] Update template.py --- utils/template.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/utils/template.py b/utils/template.py index 58cba75..0e1c684 100755 --- a/utils/template.py +++ b/utils/template.py @@ -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