3 Commits

Author SHA1 Message Date
9dbc9fc89d Ouvre le dictionnaire avec un 'with statement' 2022-01-24 16:52:59 +01:00
57c87fe986 import os : pas besoin 2022-01-24 16:48:38 +01:00
971f078ee2 Python3 2022-01-24 16:47:29 +01:00

View File

@@ -1,7 +1,6 @@
#!/usr/bin/env python #!/usr/bin/env python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import os
import sys import sys
import json import json
import argparse import argparse
@@ -64,10 +63,9 @@ args = parser.parse_args()
# Dictionary # Dictionary
if args.dictionary: if args.dictionary:
fp = args.dictionary
try : try :
f = open(fp) with open(args.dictionary, "r") as dico:
liste = json.load(f) liste = json.load(dico)
except: except:
print("Impossible d'ouvrir le fichier" + fp) print("Impossible d'ouvrir le fichier" + fp)