Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

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
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #pathlib #path #filename #extension
ADD COMMENT
Topic
Name
5+1 =