get working directory python 1

get working directory python

import os

path = os.getcwd()

print(path)
# /Users/mbp/Documents/my-project/python-snippets/notebook

print(type(path))
# 

Here is what the above code is Doing:
1. We use the os module to get the current working directory.
2. We print the path to the console.
3. We print the type of the path variable.

Similar Posts