Hi all I need a bit of help I have pounded my head against the wall trying to get this to work. I have been able to do most of what I need but I am not 100% sure if my user does not have access to write to a folder the except would be executed.
My attempt to break it did nothing my hope was that it would just write to my users My Documents folder that the except is calling but, that did not work. maybe I’m not testing it correctly.
> try: > if os.path.exists(project_dir): > file_location = (project_dir) > else: > os.makedirs(project_dir) > file_location = (project_dir) > except OSError as exc: > if exc.errno != errno.EEXIST: > raise > pass > os.makedirs(user_dir) > file_location = (user_dir)