1import os
2
3path = os.getcwd()
4
5print(path)
6# /Users/mbp/Documents/my-project/python-snippets/notebook
7
8print(type(path))
9# <class 'str'>
10
1# If by "current working directory" you mean
2# the directory in which is saved the script in execution, then:
3import os
4cwd = os.path.dirname(os.path.realpath(__file__))
5print(cwd)