Python gets the last file name and path in the path

path.split('\')[-1]
os.path.basename(path)

Guess you like

Origin blog.csdn.net/qq_36321330/article/details/115119554