Created
November 15, 2017 08:40
-
-
Save korakot/e7f04fa7bd3a8a67b729da279ab1713a to your computer and use it in GitHub Desktop.
Google colab file upload/download
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
files.download('example.txt') # from colab to browser download |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from google.colab import files | |
uploaded = files.upload() # then browse, select the files. It's then uploaded | |
# uploaded is now a dict containing "filename" -> Content |
You can download files or folder from colab like this:
from google.colab import files
#For the folder you have to zip it first and can only download later on
!zip -r bears.zip data/bears
#Download files
files.download('bears.zip')
What if I wanted to use this piece of code in a python source?
You can download files or folder from colab like this:
from google.colab import files
#For the folder you have to zip it first and can only download later on
!zip -r bears.zip data/bears
#Download files
files.download('bears.zip')
Thanks, I was just looking ways to download a whole folder/sub repository from colab.
Good Work......keep it up
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can download files or folder from colab like this:
from google.colab import files
#For the folder you have to zip it first and can only download later on
!zip -r bears.zip data/bears
#Download files
files.download('bears.zip')