get basename without extension python

40

from pathlib import Path

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

Comments

Submit
0 Comments