You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
How to read and write file (like txt or json) to Google Drive. This issue is for documentation purposes (Google struggles to answer this and took some trial and error).
from google.colab import drive
drive.mount('/content/drive')
# open existing text file
with open('/content/drive/My Drive/Sandbox/Sandbox.txt’) as f:
print(f.read())
# make new JSON file
with open('/content/drive/My Drive/Sandbox/Sandbox_2.json', 'w') as f:
f.write('{"hello":true}')
The text was updated successfully, but these errors were encountered:
jasonhargrove
changed the title
How to read and write file (like txt or json) to Google Drive
How to read and write file (like txt or json) with Colab and Google Drive
Nov 18, 2019
How to read and write file (like txt or json) to Google Drive. This issue is for documentation purposes (Google struggles to answer this and took some trial and error).
The text was updated successfully, but these errors were encountered: