This class implements a basis python interpreter. More...
#include <dynamic-graph/python/interpreter.hh>
Public Member Functions | |
Interpreter () | |
~Interpreter () | |
DYNAMIC_GRAPH_PYTHON_DEPRECATED std::string | python (const std::string &command) |
Method to start python interperter. More... | |
void | python (const std::string &command, std::string &result, std::string &out, std::string &err) |
Method to start python interperter. More... | |
void | runPythonFile (std::string filename) |
Method to exectue a python script. More... | |
void | runPythonFile (std::string filename, std::string &err) |
void | runMain (void) |
std::string | processStream (std::istream &stream, std::ostream &os) |
Process input stream to send relevant blocks to python. More... | |
PyObject * | globals () |
Return a pointer to the dictionary of global variables. More... | |
This class implements a basis python interpreter.
String sent to method python are interpreted by an onboard python interpreter.
dynamicgraph::python::Interpreter::Interpreter | ( | ) |
References dynamicgraph::python::pythonPrefix.
dynamicgraph::python::Interpreter::~Interpreter | ( | ) |
PyObject * dynamicgraph::python::Interpreter::globals | ( | ) |
Return a pointer to the dictionary of global variables.
std::string dynamicgraph::python::Interpreter::processStream | ( | std::istream & | stream, |
std::ostream & | os | ||
) |
Process input stream to send relevant blocks to python.
stream | input stream |
std::string dynamicgraph::python::Interpreter::python | ( | const std::string & | command | ) |
Method to start python interperter.
command | string to execute Method deprecated, you SHOULD handle error messages. |
void dynamicgraph::python::Interpreter::python | ( | const std::string & | command, |
std::string & | result, | ||
std::string & | out, | ||
std::string & | err | ||
) |
Method to start python interperter.
command | string to execute, result, stdout, stderr strings |
References dgDEBUG, and dynamicgraph::python::HandleErr().
void dynamicgraph::python::Interpreter::runMain | ( | void | ) |
void dynamicgraph::python::Interpreter::runPythonFile | ( | std::string | filename | ) |
Method to exectue a python script.
filename | the filename |
void dynamicgraph::python::Interpreter::runPythonFile | ( | std::string | filename, |
std::string & | err | ||
) |
References dynamicgraph::python::parse_python_exception().