Skip to content

Commit 275b47a

Browse files
committed
fix: Utilisation de pathlib pour une gestion portable des chemins.
1 parent 9b38d27 commit 275b47a

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/utils.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import math
22
import string
33
import sys
4+
from pathlib import Path
45
from typing import Any, Dict, List, TypedDict
56

67
class StatsDict(TypedDict):
@@ -114,7 +115,7 @@ def verifier_texte_dechiffre(texte: str) -> Dict[str, Any]:
114115
first_char = mot[0].lower()
115116

116117
for syl in ['Fr', 'En']:
117-
chemin=f"dico{syl}/{first_char}.txt"
118+
chemin = Path(f"dico{syl}") / f"{first_char}.txt"
118119
try:
119120
with open(chemin, 'r', encoding='latin-1') as f:
120121
for ligne in f:

0 commit comments

Comments
 (0)