create config if it doesn't exist
This commit is contained in:
parent
481b5c26fa
commit
02ca3d3a50
1 changed files with 4 additions and 1 deletions
3
main.py
3
main.py
|
@ -30,7 +30,10 @@ cfg = {
|
||||||
"strip_paired_punctuation": False
|
"strip_paired_punctuation": False
|
||||||
}
|
}
|
||||||
|
|
||||||
|
try:
|
||||||
cfg.update(json.load(open(args.cfg, 'r')))
|
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 a new issue