PyStdLib--glob

glob

glob.glob()

import glob
l = glob.glob("/root/*")    # 返回列表
print l     # 输出如下
['/root/databases',
 '/root/install.log',
 '/root/anaconda-ks.cfg',
 '/root/install',
 '/root/install.log.syslog',
 '/root/requirements.txt',
 '/root/test']