Extract file name from path in Python December 3, 2019 - by mhdr - Leave a Comment import ntpath ntpath.basename("a/b/c") References https://stackoverflow.com/questions/8384737/extract-file-name-from-path-no-matter-what-the-os-path-format