dynamicgraph::python::Interpreter Class Reference

#include <dynamic-graph/python/interpreter.hh>

Public Member Functions

 Interpreter ()
 
 ~Interpreter ()
 
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

◆ Interpreter()

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

◆ ~Interpreter()

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

Member Function Documentation

◆ globals()

PyObject * dynamicgraph::python::Interpreter::globals ( )

Return a pointer to the dictionary of global variables.

◆ processStream()

std::string dynamicgraph::python::Interpreter::processStream ( std::istream &  stream,
std::ostream &  os 
)

Process input stream to send relevant blocks to python.

Parameters
streaminput stream

◆ python() [1/2]

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.

◆ python() [2/2]

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

◆ runMain()

void dynamicgraph::python::Interpreter::runMain ( void  )

◆ runPythonFile() [1/2]

void dynamicgraph::python::Interpreter::runPythonFile ( std::string  filename)

Method to exectue a python script.

Parameters
filenamethe filename

◆ runPythonFile() [2/2]

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

The documentation for this class was generated from the following files: