dynamicgraph::python::Interpreter Class Reference

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...
 

Detailed Description

This class implements a basis python interpreter.

String sent to method python are interpreted by an onboard python interpreter.

Constructor & Destructor Documentation

dynamicgraph::python::Interpreter::Interpreter ( )
dynamicgraph::python::Interpreter::~Interpreter ( )

Member Function Documentation

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.

Parameters
streaminput stream
std::string dynamicgraph::python::Interpreter::python ( const std::string &  command)

Method to start python interperter.

Parameters
commandstring 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.

Parameters
commandstring 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.

Parameters
filenamethe filename
void dynamicgraph::python::Interpreter::runPythonFile ( std::string  filename,
std::string &  err 
)