From b32b66c28b33565fd153d8520f9631c8e5860a9d Mon Sep 17 00:00:00 2001 From: Shravan Asati Date: Sat, 12 Oct 2024 22:06:00 +0530 Subject: [PATCH] os.makedirs for pyscreenrec folder, fixes #2 --- pyscreenrec/__init__.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/pyscreenrec/__init__.py b/pyscreenrec/__init__.py index f0f99bb..1965770 100644 --- a/pyscreenrec/__init__.py +++ b/pyscreenrec/__init__.py @@ -31,12 +31,10 @@ def __init__(self) -> None: self.__running = False self.__start_mode = "start" self.screenshot_folder = os.path.join( - os.path.expanduser("~"), "pyscreenrec_data" + os.path.expanduser("~"), ".pyscreenrec_data" ) + os.makedirs(self.screenshot_folder, exist_ok=True) - # making the screenshot directory if not exists - if not os.path.exists(self.screenshot_folder): - os.mkdir(self.screenshot_folder) # clearing all the previous data if last session ended unsuccessfully self._clear_data()