diff --git a/tww.py b/tww.py index 854dbe9..4b7b247 100644 --- a/tww.py +++ b/tww.py @@ -93,6 +93,10 @@ def create_if_not_exists(fname): try: fh = open(fname, 'r') except FileNotFoundError: + import pathlib + + path = pathlib.Path(fname) + path.parent.mkdir(parents=True, exist_ok=True) fh = open(fname, 'w') fh.close()