Skip to content

Instantly share code, notes, and snippets.

@bnsheehy
Created January 7, 2022 19:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bnsheehy/e6970e2a35ff1dc2b79c87d747676c57 to your computer and use it in GitHub Desktop.
Save bnsheehy/e6970e2a35ff1dc2b79c87d747676c57 to your computer and use it in GitHub Desktop.
Python Open Local Window - Colab
# Import the libraries.
from google.colab import files
import io
import json
# Use files.upload to produce the "Choose Files" button below, then select your file.
uploaded = files.upload()
# Use io.BytesIO to decode the file, then json.load to open it.
file = io.BytesIO(uploaded['sample_credentials.json'])
credentials = json.load(file)
# Do something with the credentials.
print(credentials)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment