// @(#)root/pyroot:$Id$
// Author: Wim Lavrijsen   April 2004

#ifndef ROOT_TPython
#define ROOT_TPython

//////////////////////////////////////////////////////////////////////////////
//                                                                          //
// TPython                                                                  //
//                                                                          //
// Access to the python interpreter and API onto PyROOT.                    //
//                                                                          //
//////////////////////////////////////////////////////////////////////////////


// Bindings
#include "TPyReturn.h"

// ROOT
#ifndef ROOT_TObject
#include "TObject.h"
#endif


class TPython {

private:
   static Bool_t Initialize();

public:
// import a python module, making its classes available
   static Bool_t Import( const char* name );

// load a python script as if it were a macro
   static void LoadMacro( const char* name );

// execute a python stand-alone script, with argv CLI arguments
   static void ExecScript( const char* name, int argc = 0, const char** argv = 0 );

// execute a python statement (e.g. "import ROOT" )
   static Bool_t Exec( const char* cmd );

// evaluate a python expression (e.g. "1+1")
   static const TPyReturn Eval( const char* expr );

// bind a ROOT object with, at the python side, the name "label"
   static Bool_t Bind( TObject* object, const char* label );

// enter an interactive python session (exit with ^D)
   static void Prompt();

// type verifiers for ObjectProxy
   static Bool_t ObjectProxy_Check( PyObject* pyobject );
   static Bool_t ObjectProxy_CheckExact( PyObject* pyobject );

// type verifiers for MethodProxy
   static Bool_t MethodProxy_Check( PyObject* pyobject );
   static Bool_t MethodProxy_CheckExact( PyObject* pyobject );

// object proxy to void* conversion
   static void* ObjectProxy_AsVoidPtr( PyObject* pyobject );

// void* to object proxy conversion, returns a new reference
   static PyObject* ObjectProxy_FromVoidPtr(
      void* addr, const char* classname, Bool_t python_owns = kFALSE );

   virtual ~TPython() { }
   ClassDef(TPython,0)   //Access to the python interpreter
};

#endif
 TPython.h:1
 TPython.h:2
 TPython.h:3
 TPython.h:4
 TPython.h:5
 TPython.h:6
 TPython.h:7
 TPython.h:8
 TPython.h:9
 TPython.h:10
 TPython.h:11
 TPython.h:12
 TPython.h:13
 TPython.h:14
 TPython.h:15
 TPython.h:16
 TPython.h:17
 TPython.h:18
 TPython.h:19
 TPython.h:20
 TPython.h:21
 TPython.h:22
 TPython.h:23
 TPython.h:24
 TPython.h:25
 TPython.h:26
 TPython.h:27
 TPython.h:28
 TPython.h:29
 TPython.h:30
 TPython.h:31
 TPython.h:32
 TPython.h:33
 TPython.h:34
 TPython.h:35
 TPython.h:36
 TPython.h:37
 TPython.h:38
 TPython.h:39
 TPython.h:40
 TPython.h:41
 TPython.h:42
 TPython.h:43
 TPython.h:44
 TPython.h:45
 TPython.h:46
 TPython.h:47
 TPython.h:48
 TPython.h:49
 TPython.h:50
 TPython.h:51
 TPython.h:52
 TPython.h:53
 TPython.h:54
 TPython.h:55
 TPython.h:56
 TPython.h:57
 TPython.h:58
 TPython.h:59
 TPython.h:60
 TPython.h:61
 TPython.h:62
 TPython.h:63
 TPython.h:64
 TPython.h:65
 TPython.h:66
 TPython.h:67
 TPython.h:68
 TPython.h:69
 TPython.h:70
 TPython.h:71