python获取目录下文件夹名称

path = '/opt'
dirs = os.listdir(path)
for dir in dirs:
    print dir

  

原文地址:https://www.cnblogs.com/jacky-zhao/p/8610110.html