Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python pathlib

import pathlib

# path of the given file
print(pathlib.Path("my_file.txt").parent.absolute())

# current working directory
print(pathlib.Path().absolute())
Source by www.programiz.com #
 
PREVIOUS NEXT
Tagged: #python #pathlib
ADD COMMENT
Topic
Name
1+6 =