Skip to content

Instantly share code, notes, and snippets.

@kelly-sovacool
Last active February 24, 2023 11:19
Show Gist options
  • Save kelly-sovacool/c33b64b70164be37d75bd40c9b56b498 to your computer and use it in GitHub Desktop.
Save kelly-sovacool/c33b64b70164be37d75bd40c9b56b498 to your computer and use it in GitHub Desktop.
Google Drive file I/O with Colab Jupyter notebooks

Google Drive file I/O with Colab Jupyter notebooks

A minimal working example.

Instructions

  1. Place the Jupyter notebook in your Google Drive.
  2. In Google Drive in your web browser, open the Jupyter notebook with Colaboratory.
  3. Run the cells in this notebook to mount the drive and practice reading & writing files.

Notes

  • In this example, input.txt is a file in the top-level directory of my Google Drive.
  • You can append sub-directories to the path as needed. E.g. to access a file in a directory called my_project, use the path /content/gdrive/My Drive/my_project/.
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
testing google colab file reading
Copy link

ghost commented Dec 10, 2022

is there any way pass oath2 auth. without user interaction?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment