maxcutlyp / cits3403

CITS3403 - Agile Web Development
2 stars 0 forks source link

[Offers] Folder Creation #65

Closed JamesChandler04 closed 5 months ago

JamesChandler04 commented 5 months ago
maxcutlyp commented 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)