diff --git a/include/dynamic-graph/python/interpreter.hh b/include/dynamic-graph/python/interpreter.hh index ce9977bbd193a0f1856ad58406971701e67435d7..064ac13d82186a2e9be35a110c567b5d6101c786 100644 --- a/include/dynamic-graph/python/interpreter.hh +++ b/include/dynamic-graph/python/interpreter.hh @@ -49,6 +49,9 @@ namespace dynamicgraph { /// \param stream input stream std::string processStream(std::istream& stream, std::ostream& os); + /// \brief Return a pointer to the dictionary of global variables + PyObject* globals(); + private: /// Pointer to the dictionary of global variables PyObject* globals_; diff --git a/src/interpreter.cc b/src/interpreter.cc index 23c8b270e4a49d5fc529cdd09b49f6b1ce0ee3db..8d265a98b6dca5847a23d778e7d7c2826ba1f330 100644 --- a/src/interpreter.cc +++ b/src/interpreter.cc @@ -98,6 +98,11 @@ std::string Interpreter::python( const std::string& command ) return value; } +PyObject* Interpreter::globals() +{ + return globals_; +} + void Interpreter::runPythonFile( std::string filename ) { Py_Finalize();