I want to detect whether module has changed. Now, using inotify is simple, you just need to know the directory you want to get notifications from.
How do I retrieve
If you want to retrieve the package's root path from any of its modules, the following works (tested on Python 3.6):
from . import __path__ as ROOT_PATH print(ROOT_PATH)
The main __init__.py path can also be referenced by using __file__ instead.
__init__.py
__file__
Hope this helps!