I want to use functions defined in a .py file (uploaded to GitHub) in my Colab project.
I have a GitHub repository with a file "function.py" which contains
def SomeFunction():
return 'it works'
Inside my Colab I type
!git clone url_of_my_repository
%load function.py
SomeFunction()
And I get the following error: "name 'SomeFunction' is not defined"
答案 0 :(得分:0)
您可能需要os.chdir
进入克隆目录。