get file name from file path without extention

PHOTO EMBED

Wed Feb 09 2022 16:49:13 GMT+0000 (Coordinated Universal Time)

Saved by @lahiruaruna

from pathlib import Path

Path('/root/dir/sub/file.ext').stem
content_copyCOPY

https://stackoverflow.com/questions/678236/how-to-get-the-filename-without-the-extension-from-a-path-in-python