1

Of course I could download de "raw" version of the file from Github, and upload it to my Colab notebook... but, is there any way to use a single Github file directly in Colab?

It would be usefull if I want to use just some libraries of a proyect, without cloning the entire repository.

E.g. I would like to do something like this in Colab:

from https://raw.githubusercontent.com/ASAROVA/complejos/main/complejos.py import *

# Now I could use any tool from my library "complejos.py"
print(complejo( 0,-4)+complejo( 3,4))
...
Ali Rojas
  • 549
  • 1
  • 3
  • 12

1 Answers1

2

You can do this

!wget https://raw.githubusercontent.com/ASAROVA/complejos/main/complejos.py
from complejos import *
korakot
  • 37,818
  • 16
  • 123
  • 144