Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

directory name python

# Directory name from path of file
import os
file_name = "/home/ubuntu/Project/demo.txt"
dir_name = os.path.dirname(file_name)
print(dir_name)
 
PREVIOUS NEXT
Tagged: #directory #python
ADD COMMENT
Topic
Name
7+5 =