create config if it doesn't exist
This commit is contained in:
parent
481b5c26fa
commit
02ca3d3a50
5
main.py
5
main.py
|
@ -30,7 +30,10 @@ cfg = {
|
||||||
"strip_paired_punctuation": False
|
"strip_paired_punctuation": False
|
||||||
}
|
}
|
||||||
|
|
||||||
cfg.update(json.load(open(args.cfg, 'r')))
|
try:
|
||||||
|
cfg.update(json.load(open(args.cfg, 'r')))
|
||||||
|
except FileNotFoundError:
|
||||||
|
open(args.cfg, "w").write("{}")
|
||||||
|
|
||||||
print("Using {} as configuration file".format(args.cfg))
|
print("Using {} as configuration file".format(args.cfg))
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue