【问题标题】:Is there a way to get the ID of a Google Drive folder from the path using Colab?有没有办法使用 Colab 从路径中获取 Google Drive 文件夹的 ID?
【发布时间】:2021-04-29 20:33:46
【问题描述】:

假设我在 GDrive 上有一个文件夹,路径为 /content/drive/MyDrive/MyFolder。我知道我可以在安装 Drive 后从 Google Colab 访问文件夹的内容。但是是否也可以使用 Colab 访问该文件夹的 ID/URL,如果可以,如何访问?

【问题讨论】:

    标签: google-colaboratory


    【解决方案1】:

    您可以使用kora 从文件路径中获取 ID。

    !pip install kora
    from kora.xattr import get_id
    fid = get_id('/content/drive/MyDrive/Colab Notebooks')
    # 0B0l6No313QAhRGVwY0FtQ3l1ckk
    

    【讨论】:

    • 多亏了这个,我不需要手动输入数百个google drive文件夹的id
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2020-09-17
    • 1970-01-01
    • 2021-12-21
    • 1970-01-01
    • 2021-04-04
    • 2022-07-28
    • 1970-01-01
    相关资源
    最近更新 更多