Skip to content

Instantly share code, notes, and snippets.

@chengengliu
Last active June 15, 2021 01:03
Show Gist options
  • Save chengengliu/23ebcefa5aa49b870a3d774e0a582dbe to your computer and use it in GitHub Desktop.
Save chengengliu/23ebcefa5aa49b870a3d774e0a582dbe to your computer and use it in GitHub Desktop.
Import file from Google Drive into Colab

import sys </br> from google.colab import drive

print out files under the root dir of your drive:
!ls /content/gdrive/My\ Drive/

tell code lab to mound on google drive, you may be asked for auth token
drive.mount('/content/gdrive/')

directed to the dir that leads to the target file
sys.path.append('[path_to_your_file]')

import XXX as xx

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