Colaboratory:我可以访问我的 Google 云端硬盘文件夹和文件吗? [英] Colaboratory: Can I access to my Google drive folder and file?

查看:46
本文介绍了Colaboratory:我可以访问我的 Google 云端硬盘文件夹和文件吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Google Colaboratory 真的很酷,但如果我可以访问我所有的 google drive 文件,而不使用标准的 google drive API,它会更有用.

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?

推荐答案

下面是一个使用 FUSE Drive 接口访问 Drive 文件(如本地文件)的示例:https://colab.research.google.com/notebook#fileId=1srw_HFWQ2SMgmWIawucXfusGzrj1_U0q

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

简而言之:

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

执行上述代码后,您的云端硬盘文件将出现在 /content/drive/My Drive 中.

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

我猜您还发现了捆绑的示例 I/O 笔记本,它还展示了如何使用 Python API 来访问文件.(这需要更少的配置.)https://colab.research.google.com/notebook#fileId=/v2/external/notebooks/io.ipynb&scrollTo=c2W5A2px3doP

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

这篇关于Colaboratory:我可以访问我的 Google 云端硬盘文件夹和文件吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆