Created
August 21, 2019 02:56
-
-
Save HoweChen/ccc78974e632e33ece7ecea605ca82af to your computer and use it in GitHub Desktop.
[创建文件夹如果文件夹不存在]#Python
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| try: | |
| # logs folder initialization | |
| self.logs_path = Path("./logs") | |
| self.logs_path.mkdir(exist_ok=True) | |
| # repos folder initialization | |
| self.repos_path = Path("./repos") | |
| self.repos_path.mkdir(exist_ok=True) | |
| # issues folder initialization | |
| self.issues_path = Path("./issues") | |
| self.issues_path.mkdir(exist_ok=True) | |
| except (FileExistsError, FileNotFoundError) as e: | |
| self.logger.exception(e) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment