Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
613 views
in Technique[技术] by (71.8m points)

jupyter notebook - Colaboratory: Can I access to my Google drive folder and file?

Google Colaboratory is really cool, but it would be more useful if I can access all my google drive files, without using standard google drive API.

Is it possible and easy? and how?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Here's an example of using a FUSE Drive interface to access your Drive files like local files: https://colab.research.google.com/notebook#fileId=1srw_HFWQ2SMgmWIawucXfusGzrj1_U0q

In short:

# Load the Drive helper and mount
from google.colab import drive
drive.mount('/content/drive')

After executing the code above, your Drive files will be present in /content/drive/My Drive.

I'm guessing you also found the bundled example I/O notebook, which shows how to use Python APIs to access files as well. (This requires a bit less configuration.) https://colab.research.google.com/notebook#fileId=/v2/external/notebooks/io.ipynb&scrollTo=c2W5A2px3doP


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...