Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

split filename and extension python

>>> import os
>>> filename, file_extension = os.path.splitext('/path/to/somefile.ext')
>>> filename
'/path/to/somefile'
>>> file_extension
'.ext'
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #split #filename #extension #python
ADD COMMENT
Topic
Name
7+3 =