Adding a module#
This site explains how to create a new module, both for the generic part and for the application.
The following illustration shows the structure of the project:
Application
├── src
│ ├── __init__.py
│ ├── db.py
│ └── tetue_generic
│ ├── __init__.py
│ └── watcher.py
└── main.py
Generic#
The watcher module with new functions should be added to the generic folder.
Add new file watcher.py in tetue_generic directory
Add import for watcher in __init__.py in src directory
from .tetue_generic.watcher import *
Now the functions in watcher.py are available in main.py
Application#
The db module with new functions should be added to the app folder.
Add new file db.py in src directory
Add import for db in __init__.py in src directory
from .db import *
Now the functions in db.py are available in main.py with
import src
src.new_func_from_db()