Closed JamesChandler04 closed 5 months ago
os.makedirs(folderpath, exist_ok=True)
to avoid having to check first - exist_ok
will make it do nothing if the folder already exists. Avoids race conditions where e.g. the folder is created/deleted between checking and creating the folder/saving a file under it (and less lines of code :p)