fnmatch 模块判断路径是否符合要求,支持通配符
your_path = ""
your_rule = ""
print(fnmatch('EqualsAlwaysTrue.java', 'src/EqualsAlwaysTrue.java'))
# False
print(fnmatch('src/EqualsAlwaysTrue.java', '*/EqualsAlwaysTrue.java'))
# True
print(fnmatch(your_path , your_rule ))
判断前者路径是否符合后者的规则,无需实际文件路径