Working with modules

In this notebook we will work with external modules. Notebooks are great for documenting a work process and for on-going work, but they are not practical for re-usability. If you have written a set of functions that you plan to use in several projects (i.e. different notebooks) you need to have them in a module that you can import from anywhere.

In this notebook we will explore how to work with modules. Therefore this module is not self-consisent and needs external modules.

Start by writing a module with some variable definitions and add some printing statements. Save it as module1.py and import it.


In [1]:
import module1


---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-1-59682e3e9abf> in <module>()
----> 1 import module1

ImportError: No module named 'module1'

autoreload

Where to put modules


In [ ]: