Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

get path to file without filename python

import os
filepath = '/a/path/to/my/file.txt'
os.path.dirname(filepath)
# Yields '/a/path/to/my'
 
PREVIOUS NEXT
Tagged: #path #file #filename #python
ADD COMMENT
Topic
Name
6+5 =