51 const char* acn,
int* argc,
char** argv,
Bool_t ) :
81 Gl_histinit( (
char*)
"-" );
95 PyObject* argl = PySys_GetObject(
const_cast< char*
>(
"argv" ) );
98 if ( argl && 0 < PyList_Size( argl ) ) argc = (int)PyList_GET_SIZE( argl );
99 char** argv =
new char*[ argc ];
100 for (
int i = 1; i < argc; ++i ) {
102 if ( strcmp( argi,
"-" ) == 0 || strcmp( argi,
"--" ) == 0 ) {
109#if PY_VERSION_HEX < 0x03000000
110 if ( Py_GetProgramName() && strlen( Py_GetProgramName() ) != 0 )
111 argv[ 0 ] = Py_GetProgramName();
113 argv[ 0 ] = (
char*)
"python";
116 argv[ 0 ] = (
char*)
"python";
138#if PY_VERSION_HEX < 0x03000000
#define PyROOT_PyUnicode_AsString
R__EXTERN TApplication * gApplication
R__EXTERN TBenchmark * gBenchmark
void(* ErrorHandlerFunc_t)(int level, Bool_t abort, const char *location, const char *msg)
ErrorHandlerFunc_t SetErrorHandler(ErrorHandlerFunc_t newhandler)
Set an errorhandler function. Returns the old handler.
R__EXTERN TStyle * gStyle
R__EXTERN const char * gProgName
R__EXTERN TSystem * gSystem
static Bool_t InitROOTGlobals()
Setup the basic ROOT globals gBenchmark, gStyle, gProgname, if not already set.
TPyROOTApplication(const char *acn, Int_t *argc, char **argv, Bool_t bLoadLibs=kTRUE)
static Bool_t CreatePyROOTApplication(Bool_t bLoadLibs=kTRUE)
static Bool_t InitROOTMessageCallback()
Install ROOT message handler which will turn ROOT error message into python exceptions.
This class creates the ROOT Application Environment that interfaces to the windowing system eventloop...
void SetReturnFromRun(Bool_t ret)
virtual Long_t ProcessLine(const char *line, Bool_t sync=kFALSE, Int_t *error=0)
Process a single command line, either a C++ statement or an interpreter command starting with a "....
This class is a ROOT utility to help benchmarking applications.
TStyle objects may be created to define special styles.
virtual void SetProgname(const char *name)
Set the application name (from command line, argv[0]) and copy it in gProgName.
void ErrMsgHandler(int level, Bool_t abort, const char *location, const char *msg)
Translate ROOT error/warning to python.