Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python how to get the folder name of a file

# Basic syntax:
import os
os.path.dirname('/path/to/your/favorite/file.txt')
--> '/path/to/your/favorite/'
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #python #folder #file
ADD COMMENT
Topic
Name
9+7 =