I have a Python script and I want to check if a file exists, but I want to ignore case
eg.
path = '/Path/To/File.log'
if os.path.isfile(path):
return true
The directory may look like this "/path/TO/fILe.log". But the above should still return true.
S
of all absolute paths in the filesystem using os.walk
, lowering them all as you collect them using str.lower
.if my_path.lower() in S
.