Obtenez le nom de base sans extension python
from pathlib import Path
Path('/root/dir/sub/file.ext').stem
# returns file
minty_mosquito_69
from pathlib import Path
Path('/root/dir/sub/file.ext').stem
# returns file