Importing .py files in Google Colab

前端 未结 10 2163
清酒与你
清酒与你 2020-11-28 22:38

Is there any way to upload my code in .py files and import them in colab code cells?

The other way I found is to create a local Jupyter notebook then upload it to C

10条回答
  •  甜味超标
    2020-11-28 23:08

    1. You can upload local files to google colab by using upload() function in google.colab.files
    2. If you have files on github, then clone the repo using !git clone https://github.com/username/repo_name.git. Then just like in jupyter notebook load it using the magic function %load %load filename.py.

提交回复
热议问题