【发布时间】:2018-08-03 11:29:44
【问题描述】:
我在 google colab 中执行这部分代码,以授权我访问我的驱动器文件夹
!apt-get install -y -qq software-properties-common python-software-properties module-init-tools
!add-apt-repository -y ppa:alessandro-strada/ppa 2>&1 > /dev/null
!apt-get update -qq 2>&1 > /dev/null
!apt-get -y install -qq google-drive-ocamlfuse fuse
from google.colab import auth
auth.authenticate_user()
from oauth2client.client import GoogleCredentials
creds = GoogleCredentials.get_application_default()
import getpass
!google-drive-ocamlfuse -headless -id={creds.client_id} -secret=
{creds.client_secret} < /dev/null 2>&1 | grep URL
vcode = getpass.getpass()
!echo {vcode} | google-drive-ocamlfuse -headless -id=
{creds.client_id} -secret={creds.client_secret}
但是当涉及到从给定的url复制和粘贴验证码的部分时,执行并没有结束,所以继续下一个块。有什么问题?即使我仍然处于连接状态。
【问题讨论】:
标签: directory authorization google-colaboratory drive