(Dec-22-2019, 12:01 PM)lastyle Wrote: But os.Path.Isdir returns the complete pathNo it return True or False,it dos a test if it's a folder and that folder exits.
>>> os.path.isdir(r'E:\div_code\pan') True >>> os.path.isdir(r'E:\div_code\pan999') False
(Dec-22-2019, 12:01 PM)lastyle Wrote: So I need to check if the return value if it contains bestfile.This i don't understand,in code dos regex
.*bestfile.*
the check,and only return files that match this regex.