python获取目录下文件夹名称

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

 

posted @ 2017-03-07 16:43  星星故乡  阅读(15293)  评论(0编辑  收藏  举报