You can use the build in __file__
variable. It contains the path of the current file. I would implement getBaseOfProject in a module in the root of your project. There I would get the path part of __file__
and would return that. This method can then be used everywhere in your project.