Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

get file extension python

import pathlib

print(pathlib.Path('yourPath.example').suffix) # '.example'
#or 
import os
filename, file_extension = os.path.splitext('/path/to/somefile.ext')
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #file #extension #python
ADD COMMENT
Topic
Name
5+7 =