[Python]打印指定目录下所有子目录

import os

for root,dirs,files in os.walk(r"/home/os-hy01"):
    for dir in dirs:
         print(dir)

--2020-03-16--

原文地址:https://www.cnblogs.com/heyang78/p/12503905.html