import os path = os.getcwd() print(path) # /Users/mbp/Documents/my-project/python-snippets/notebook print(type(path)) # <class 'str'>
import os cwd = os.getcwd()
import os os.getcwd()
import os dir_path = os.path.dirname(os.path.realpath(__file__))