My python project path /project
and these are its files :
/project/test.py
/project/templates/
/project/includes/
/project/includes/config.py
# config.py
import os
template_path = os.path.join(os.path.dirname(__file__), "templates")
when I used execute() function to include config.py from test.py , the /project/includes/config.php
file was executed and the result was returned to /project/includes/test.py
so template_path variable was saved as /project/includes/templates/
and templates folder would not be found there .
I want a function to include /project/includes/config.py
from /project/test.py
and execute all functions in /project/includes/config.py
through test.py
.