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']
2023-11-30 18:04:10
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']