Monday, 11 October 2021

Find path of python_notebook.ipynb when running it with Google Colab

I want to find the cwd where my CODE file is stored.

With jupiter Lab i would do:

import os 
cwd= os.getcwd()
print (cwd)
OUT: 
'C:...\\Jupiter_lab_notebooks\\CODE'

However,if i copy the folders to my GoogleDrive, and run the notebook in GOOGLE COLAB, i get:

import os 
cwd= os.getcwd()
print (cwd)
OUT: 
/content

No matter where my notebook is stored. How do i find the actual path my .ipynb folder is stored in?



from Find path of python_notebook.ipynb when running it with Google Colab

No comments:

Post a Comment