I have a list of full file paths:
filelist = [
"C:\Folder1\Files\fileabc.txt",
"C:\Folder1\Files\filedef.txt",
"C:\Folder2\Data\file123.txt"
]
I want to find a file in the list by its basename, with the extension, but without specifying full path.
I've tried something like this:
name = "filedef.txt"
if name in filelist:
print "Found"
But it doesn't work.
Any hints?