MyPaths.py should be put into a separate module, only one time. It is expected to be imported in any module that needs access to the path structure.
I show it as a separate module in post 6 (first one) https://python-forum.io/thread-37451-pos...#pid158233.
That code should be saved once as MyPaths.py. (rename, if you wish, filename and class name should be the same then import name needs to be the same as the new class name).
Try the example in post 10. It shows exactly how to do this. The MyPaths.py module only has to be coded once, same with the virtual environment, once per project no mater how many modules it contains.
There is a tutorial that i wrote, not for this purpose, see SqlPaths.py, and note that it's included in each module.
https://python-forum.io/thread-24127.html
One great side effect of keeping paths separate is that a path can be changed and all other code will immediately use the new path.
I show it as a separate module in post 6 (first one) https://python-forum.io/thread-37451-pos...#pid158233.
That code should be saved once as MyPaths.py. (rename, if you wish, filename and class name should be the same then import name needs to be the same as the new class name).
Try the example in post 10. It shows exactly how to do this. The MyPaths.py module only has to be coded once, same with the virtual environment, once per project no mater how many modules it contains.
There is a tutorial that i wrote, not for this purpose, see SqlPaths.py, and note that it's included in each module.
https://python-forum.io/thread-24127.html
One great side effect of keeping paths separate is that a path can be changed and all other code will immediately use the new path.