Fonction pour charger le dictionnaire et début de mise en forme du programme
This commit is contained in:
parent
5e60b32352
commit
1563e1bf1d
12
wgamesolv.py
12
wgamesolv.py
@ -62,10 +62,9 @@ parser.add_argument(
|
||||
|
||||
args = parser.parse_args()
|
||||
|
||||
# Dictionary
|
||||
if args.dictionary:
|
||||
def load_dict(dict_file):
|
||||
try :
|
||||
with open(args.dictionary, "r") as dico:
|
||||
with open(dict_file, "r") as dico:
|
||||
liste = json.load(dico)
|
||||
except:
|
||||
print("Impossible d'ouvrir le fichier" + fp)
|
||||
@ -198,6 +197,13 @@ if bl:
|
||||
if invalidate == 0:
|
||||
blFilter.append(mot)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
liste = load_dict(args.dictionary)
|
||||
liste = resolv_len(liste, nb)
|
||||
|
||||
|
||||
|
||||
# Affiche du résultat
|
||||
if pattern and kl and bl:
|
||||
print(", ".join(blFilter))
|
||||
|
Loading…
Reference in New Issue
Block a user