Answers for "pathlib path get filename with extension"

0

pathlib path get filename with extension

>>> from pathlib import Path
>>> p = Path("/home/user/Downloads/repo/test.txt")
>>> print(p.stem)
test
>>> print(p.name)
test.txt
Posted by: Guest on May-20-2021

Code answers related to "pathlib path get filename with extension"

Browse Popular Code Answers by Language