Answers for "show current python path"

9

get path to current directory python

import os
os.path.abspath(os.getcwd())
Posted by: Guest on September-16-2020
3

find python path windows

>>> import os
>>> import sys
>>> os.path.dirname(sys.executable)
'C:\\Python25'
Posted by: Guest on December-09-2020
2

python get path of current file

import pathlib
pathlib.Path(__file__).parent.absolute()
Posted by: Guest on April-04-2020

Python Answers by Framework

Browse Popular Code Answers by Language