Get File Name from File Path in Python
Let’s say you did a search for files matching a certain pattern in a directory using Python:
import glob
filePaths = glob.glob("C:\\Temp\\*.txt")
print filePaths
This will list the full file paths with a .txt extension in the C:\Temp directory. For example: C:\\Temp\\test.txt.
But if you wanted to get just the file name, how would you go about that? It took [...] Read more »
