Local modules don’t update

  • Hi Drawbot team,

    I have recently started with DrawBot and came across a problem with importing local modules. I am trying to reuse some code within different DB scripts (without making it a PyPI package). Here is my file structure:


    Here is the top of myProject/main.py:

    from DBlib.utils import *

    This works, however when running myProject/main.py DrawBot app does not seem to detect changes in myProject/DBlib/utils.py until I restart the app and re-run myProject/main.py. Is there something I am doing wrong with importing my local module?


  • To update the contents of a module, you need to reload it

  • reload is python 2
    afaik in python 3.4 and newer you are supposed to use:

    import importlib

    good luck!

Log in to reply