how to search on file name then add the extension python code example Example: os extension >>> os.path.splitext('/a/b.c/d') ('/a/b.c/d', '')