get basename without extension python

30

from pathlib import Path

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

Comments

Submit
0 Comments