본문 바로가기
Programming/Google Colaboratory

[구글 코랩] 구글 드라이브 마운트

by goatlab 2022. 8. 14.
728x90
반응형
SMALL

구글 드라이브

 

 

Google Drive는 다른 사용자와 콘텐츠를 공유할 수 있도록 안전한 개인용 클라우드 스토리지 옵션이 제공되는 파일 공유 플랫폼이다.

 

마운트

 

마운트 (mount)는 컴퓨터 과학에서 저장 장치에 접근할 수 있는 경로를 디렉터리 구조에 편입시키는 작업을 말한다.

 

import os

print(os.getcwd())
print(os.listdir())
/content
['.config', 'sample_data']
from google.colab import drive   

drive.mount('/content/gdrive/')
Mounted at /content/gdrive/
print(os.getcwd())
print(os.listdir())
/content
['.config', 'gdrive', 'sample_data']
import shutil

try:
    shutil.copy('/content/gdrive/My Drive/Colab Notebooks/test.zip', '/content/')

except Exception as err:
    print(str(err))
print(os.getcwd())
print(os.listdir())
/content
['.config', 'gdrive', 'test.zip', 'sample_data']
728x90
반응형
LIST

'Programming > Google Colaboratory' 카테고리의 다른 글

구글 코랩 (Google Colaboratory)  (0) 2022.07.10