[PYTHON] Jupyter Study Note_005

How to clone a GitHub repository to google colab

The procedure is as follows.

--Mount google drive

google_drive.py


from google.colab import drive
drive.mount('/content/drive')

--Create a repository in the location specified by git clone

git_clone.py


import shutil
import os

#Change the current directory
os.chdir('/content/drive/My Drive')
cur_dir = os.getcwd()
git_name = '/MongoDB_PyMongo_Tutorial'
git_folder = cur_dir + git_name

#Delete if it exists
if os.path.exists(git_folder):
    shutil.rmtree(git_folder)

#Clone
!git clone https://github.com/Giffy/MongoDB_PyMongo_Tutorial.git

--Implementation result git_clone

Recommended Posts

Jupyter Study Note_002
Jupyter Study Note_003
Jupyter Study Note_007
Jupyter Study Note_005
Python study note_002
Jupyter study notes_006
Python study note_004
Python study note_003
Jupyter study notes_008
Jupyter study notes_004
Jupyter study notes_001
Note
Note
[WIP] Fluent Python Study Note
Study Note 9_Install Jenkins on CentOS7
Django note 4
pyenv note
Jupyter Tips 4
Jupyter nbextensions
Jupyter Tips 5
"Python Machine Learning Programming" Summary Note (Jupyter)
Jupyter Tips 2
Note: Python
Jupyter tricks
Python note
Django Note 1
Django note 3
[Note] RepresenterError
Install and set Jupyter Notebook to create a study note creation environment [Mac]