Logo ROOT  
Reference Guide
TPython Class Reference

Definition at line 23 of file TPython.h.

Public Member Functions

virtual ~TPython ()
 

Static Public Member Functions

static Bool_t Bind (TObject *object, const char *label)
 Bind a ROOT object with, at the python side, the name "label". More...
 
static const TPyReturn Eval (const char *expr)
 Evaluate a python expression (e.g. More...
 
static Bool_t Exec (const char *cmd)
 Execute a python statement (e.g. "import ROOT"). More...
 
static void ExecScript (const char *name, int argc=0, const char **argv=0)
 Execute a python stand-alone script, with argv CLI arguments. More...
 
static Bool_t Import (const char *name)
 Import the named python module and create Cling equivalents for its classes and methods. More...
 
static void LoadMacro (const char *name)
 Execute the give python script as if it were a macro (effectively an execfile in main), and create Cling equivalents for any newly available python classes. More...
 
static Bool_t MethodProxy_Check (PyObject *pyobject)
 Test whether the type of the given pyobject is of MethodProxy type or any derived type. More...
 
static Bool_t MethodProxy_CheckExact (PyObject *pyobject)
 Test whether the type of the given pyobject is MethodProxy type. More...
 
static voidObjectProxy_AsVoidPtr (PyObject *pyobject)
 Extract the object pointer held by the ObjectProxy pyobject. More...
 
static Bool_t ObjectProxy_Check (PyObject *pyobject)
 Test whether the type of the given pyobject is of ObjectProxy type or any derived type. More...
 
static Bool_t ObjectProxy_CheckExact (PyObject *pyobject)
 Test whether the type of the given pyobject is ObjectProxy type. More...
 
static PyObjectObjectProxy_FromVoidPtr (void *addr, const char *classname, Bool_t python_owns=kFALSE)
 Bind the addr to a python object of class defined by classname. More...
 
static void Prompt ()
 Enter an interactive python session (exit with ^D). More...
 

Static Private Member Functions

static Bool_t Initialize ()
 

#include <TPython.h>

Constructor & Destructor Documentation

◆ ~TPython()

virtual TPython::~TPython ( )
inlinevirtual

Definition at line 65 of file TPython.h.

Member Function Documentation

◆ Bind()

Bool_t TPython::Bind ( TObject object,
const char *  label 
)
static

Bind a ROOT object with, at the python side, the name "label".

Definition at line 434 of file TPython.cxx.

◆ Eval()

const TPyReturn TPython::Eval ( const char *  expr)
static

Evaluate a python expression (e.g.

"ROOT.TBrowser()").

Caution: do not hold on to the return value: either store it in a builtin type (implicit casting will work), or in a pointer to a ROOT object (explicit casting to a void* is required).

Definition at line 381 of file TPython.cxx.

◆ Exec()

Bool_t TPython::Exec ( const char *  cmd)
static

Execute a python statement (e.g. "import ROOT").

Definition at line 353 of file TPython.cxx.

◆ ExecScript()

void TPython::ExecScript ( const char *  name,
int  argc = 0,
const char **  argv = 0 
)
static

Execute a python stand-alone script, with argv CLI arguments.

example of use: const char* argv[] = { "1", "2", "3" }; TPython::ExecScript( "test.py", sizeof(argv)/sizeof(argv[0]), argv );

Definition at line 285 of file TPython.cxx.

◆ Import()

Bool_t TPython::Import ( const char *  name)
static

Import the named python module and create Cling equivalents for its classes and methods.

Definition at line 150 of file TPython.cxx.

◆ Initialize()

Bool_t TPython::Initialize ( )
staticprivate

Definition at line 93 of file TPython.cxx.

◆ LoadMacro()

void TPython::LoadMacro ( const char *  name)
static

Execute the give python script as if it were a macro (effectively an execfile in main), and create Cling equivalents for any newly available python classes.

Definition at line 215 of file TPython.cxx.

◆ MethodProxy_Check()

Bool_t TPython::MethodProxy_Check ( PyObject pyobject)
static

Test whether the type of the given pyobject is of MethodProxy type or any derived type.

Definition at line 501 of file TPython.cxx.

◆ MethodProxy_CheckExact()

Bool_t TPython::MethodProxy_CheckExact ( PyObject pyobject)
static

Test whether the type of the given pyobject is MethodProxy type.

Definition at line 514 of file TPython.cxx.

◆ ObjectProxy_AsVoidPtr()

void * TPython::ObjectProxy_AsVoidPtr ( PyObject pyobject)
static

Extract the object pointer held by the ObjectProxy pyobject.

Definition at line 527 of file TPython.cxx.

◆ ObjectProxy_Check()

Bool_t TPython::ObjectProxy_Check ( PyObject pyobject)
static

Test whether the type of the given pyobject is of ObjectProxy type or any derived type.

Definition at line 474 of file TPython.cxx.

◆ ObjectProxy_CheckExact()

Bool_t TPython::ObjectProxy_CheckExact ( PyObject pyobject)
static

Test whether the type of the given pyobject is ObjectProxy type.

Definition at line 487 of file TPython.cxx.

◆ ObjectProxy_FromVoidPtr()

PyObject * TPython::ObjectProxy_FromVoidPtr ( void addr,
const char *  classname,
Bool_t  python_owns = kFALSE 
)
static

Bind the addr to a python object of class defined by classname.

Definition at line 544 of file TPython.cxx.

◆ Prompt()

void TPython::Prompt ( )
static

Enter an interactive python session (exit with ^D).

State is preserved between successive calls.

Definition at line 460 of file TPython.cxx.


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