get wd in python
import os path = os.getcwd() print(path) # /Users/mbp/Documents/my-project/python-snippets/notebook print(type(path)) # <class 'str'>
Source: note.nkmk.me
python get current directory
import os print(os.getcwd())
working directory python
import os cwd = os.getcwd()
Source: stackoverflow.com
get working directory python
import os os.getcwd()
get current working directory python
# print current working directory in python import os cwd = os.getcwd() print(cwd)
Current working Directory in python
import pathlib print(pathlib.Path(__file__).parent.absolute())
Source: www.delftstack.com