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

import os

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

--2020-03-16--

 

posted @ 2020-03-16 14:54  逆火狂飙  阅读(455)  评论(0)    收藏  举报