Google Colab: Reload imported modules

google-colaboratory, import, module

Solution

You can restart the runtime (which is annoying), or use something like

import importlib
importlib.reload(functions.readfunctions)

Problem

I have a file readfunctions.py inside a folder called functions (in this folder there is also a "init.py" file). In the file readfunctions.py I have defined a function called "read_from_shower". ``` ./functions readfunctions.py __init__.py ``` So, I have imported this in my Google Colab Session (from GitHub after I cloned the repository): ``` from functions.readfunctions import read_from_shower ``` And it works fine. But then, I have made some changes in my function "read_from_shower" but I can't reload it in Colab. How can I do it?

Original source