How to get the filename without the extension from a path in Python?
For instance, if I had "/path/to/some/file.txt", I would want "
"/path/to/some/file.txt"
"
Using pathlib in Python 3.4+
from pathlib import Path Path('/root/dir/sub/file.ext').stem
will return
'file'