You are here

Interpreted Cpp In Python

This code example shows an example of how the ROOT Python bindings, PyROOT, can be used. When using PyROOT, what happens in the C++ world is immediately mirrored in the Python one: in this example we call a function defined in C++ and compiled at runtime. This example shows how ROOT allows to mix the Python and C++ languages. From within PyROOT, one can invoke Cling to interpret code, in this case via the TInterpreter::Declare method (gInterpreter is the global variable used to access the interpreter).