get wd in python
import os
path = os.getcwd()
print(path)
# /Users/mbp/Documents/my-project/python-snippets/notebook
print(type(path))
# <class 'str'>
working directory python
import os
cwd = os.getcwd()
python get current directory
import os
print(os.getcwd())
get diroctary in python
import os
cwd = os.getcwd()
print(cwd)
get path to current directory python
import os
os.path.abspath(os.getcwd())
get current directory python
import os
current_working_directory = os.getcwd()
print(current_working_directory) # should print the cwd
""" Bonus: If you want to change cwd, without moving file,
use the following method"""
os.chdir("path/to/directory")