折叠和展开后,Google colab文件标签消失了

时间:2018-09-04 10:11:36

标签: user-interface google-colaboratory

在google colab中,我使用以下代码将google驱动器安装到虚拟机:

# Install a Drive FUSE wrapper.
# https://github.com/astrada/google-drive-ocamlfuse
!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



# Generate auth tokens for Colab
from google.colab import auth
auth.authenticate_user()


# Generate creds for the Drive FUSE library.
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}


# Create a directory and mount Google Drive using that directory.
!mkdir -p My Drive
!google-drive-ocamlfuse My Drive


!ls My Drive/

# Create a file in Drive.
#!echo "This newly created file will appear in your Drive file list." > My Drive/created.txt

这将挂载Google驱动器。左侧有一个文件选项卡,可用于浏览我已挂载的文件:

Image showing the file browser tab I'm referring to

但是,如果我单击十字以折叠此侧窗,然后再次将其展开,则“文件”选项卡将丢失,并且除了关闭并重新打开文档外,我不知道如何恢复它。这是错误吗?有没有一种方法可以在不关闭和重新打开的情况下取回选项卡?

Image showing the file tab missing after collapsing and expanding

我发现“文件”选项卡非常有用,因为您可以直接从中复制路径并执行其他活动。

另一个问题,但与问题无关,通过使用ocamlfuse融合驱动器,我认为这实际上并未将整个驱动器上传到虚拟机吗?如果我想从一个文件夹中读取每个文件(300个.xls或.csv文件),对它们执行功能并编写一个新文件,那么它会比融合驱动器更快,而不是用不同的方式上传文件夹,例如.zip或.tar文件?

This的穆罕默德·吉哈德(Mohamed Jihad)回答直接使用pydrive上传了一个.zip文件,然后将其存储在本地VM中,以便随后读取文件更快吗?

0 个答案:

没有答案