diff --git a/Applications/ApplicationsLib/ProjectData.cpp b/Applications/ApplicationsLib/ProjectData.cpp index 81703eace73cb69df404e3f6444e30a2b80c7815..d55c082006dc94066e9f7db761e6d3dde7b74e2e 100644 --- a/Applications/ApplicationsLib/ProjectData.cpp +++ b/Applications/ApplicationsLib/ProjectData.cpp @@ -288,6 +288,9 @@ ProjectData::ProjectData(BaseLib::ConfigTree const& project_config, // Evaluate in scope of main module py::object scope = py::module::import("__main__").attr("__dict__"); + // add (global) variables + auto globals = py::dict(scope); + globals["ogs_prj_directory"] = project_directory; py::eval_file(script_path, scope); #else OGS_FATAL("OpenGeoSys has not been built with Python support.");