Manipulating sys.path in the Notebook§

You can add your module’s sub-directory to Pythons path like this:

import os
import sys
sys.path.insert(0, os.path.abspath('../module-subdirectory'))

… then you can simply import it:

import mymodule
Hello, world!

Of course it is quite ugly to show this path manipulation in each notebook. You can also move this to a helper module, see this notebook.