I have stored a test.py in the dbfs at the below location "/dbfs/FileStore/shared_uploads/krishna@company.com/Project_Folder/test.py"
I have a print statement in test.py which says the below
print( os.getcwd() )
and it prints the below
'/databricks/driver'
This is utterly weird as I am not getting the correct path
Btw, the same thing happens with a notebook as well.
So I have a notebook "test_nb.ipynb"" at the below location
"/dbfs/FileStore/shared_uploads/krishna@company.com/Project_Folder/test_nb.ipynb"
I have the same print statement in test_nb.py which says the below:
print( os.getcwd() )
and it prints the below
'/databricks/driver'
Can someone please help me to print the correct path ?? When you answer, please can you make sure not to make the answer specific to a notebook as I actually need to print the path of a .py file
TIA