Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision | Next revisionBoth sides next revision | ||
devwiki:python [2024/01/11 02:32] – [file operation] ying | devwiki:python [2024/01/11 02:48] – [file operation] ying | ||
---|---|---|---|
Line 938: | Line 938: | ||
pass | pass | ||
| | ||
- | # method 3: all in one check and create if needed | + | # method 3: all in one check and create if needed, like method 2 but not need try and except since it will be ok for exist |
os.makedirs(os.path.dirname(output_path), | os.makedirs(os.path.dirname(output_path), | ||
</ | </ |