Les jokers peuvent être utilisés
pywildcard.py
# -*- coding: utf-8 -*-
import pywildcard
dirs = ['hello/world.py', 'hello/world.pyc', 'hello/world/other/folder/example.py']
print pywildcard.filter(dirs, 'hello/*')
# ['hello/world.py', 'hello/world.pyc', 'hello/world/other/folder/example.py']
print pywildcard.filter(dirs, 'hello/*.py')
# ['hello/world.py', 'hello/world/other/folder/example.py']
Recommended Posts