Answers for "how to get directory of python package"

2

python get dir

import os 
#full path
dir_path = os.path.dirname(os.path.realpath(__file__))

#current dir
cwd = os.getcwd()
Posted by: Guest on December-25-2020
0

python get packages path

path = os.path.dirname(a_module.__file__)
Posted by: Guest on July-25-2020
0

python how to get directory of script

import os
print(os.path.abspath(''))
Posted by: Guest on December-04-2020
0

how do i get parent directory python

from pathlib import Path
path = Path(Path.cwd())
print(path.parent)
Posted by: Guest on November-29-2020

Code answers related to "how to get directory of python package"

Python Answers by Framework

Browse Popular Code Answers by Language