Skip to content

Instantly share code, notes, and snippets.

Created July 20, 2019 19:25
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
from google.colab import drive
import os
def create_folder_gdrive(folder: str):
drive2mount = "/gdrive"
drive.mount(drive2mount, force_remount=True)
root_folder = os.path.join(drive2mount,"My Drive", folder)
return root_folder
root_folder = create_folder_gdrive("myfolder")
test_file =os.path.join(root_folder, 'foo.txt')
with open(test_file, 'w') as f:
f.write('Hello Google Drive!')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment