python3创建目录

感觉python3最好用的创建目录函数是os.makedirs,它可以设置在多级目录不存在时自动创建,已经存在也不抛出异常。

import os
os.makedirs('hello/hello1/hello2',exist_ok=True)

 

posted @ 2017-02-20 09:29  lvmememe  阅读(1361)  评论(0编辑  收藏  举报