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

阅读 70

2023-04-28

#首先给一个路径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)

0 0 举报