Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python pathlib os module

import os

# path of the given file
print(os.path.dirname(os.path.abspath("my_file.txt")))

# current working directory
print(os.path.abspath(os.getcwd()))
Source by www.programiz.com #
 
PREVIOUS NEXT
Tagged: #python #pathlib #os #module
ADD COMMENT
Topic
Name
2+4 =