0
点赞
收藏
分享

微信扫一扫

软件设计师笔记--计算机系统知识

猎书客er 2023-04-28 阅读 70
html前端

#首先给一个路径path:

path = r"C:\A\B\C"

def mkdir_work(path):

        if path == r"C:":

                return

        if os.path.exists(path):

                return

        else:

                path_one,path_two = os.path.split(path)

                if os.path.exists(path_one):

                        os.mkdir(path)

                else:

                        mkdir_work(path_one)

                        os.mkdir(path)

举报

相关推荐

0 条评论