Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

pathlib get extension

import pathlib

print(pathlib.Path('yourPath.example').suffix) # '.example'
print(pathlib.Path("hello/foo.bar.tar.gz").suffixes) # ['.bar', '.tar', '.gz']
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #pathlib #extension
ADD COMMENT
Topic
Name
8+9 =