CVB++ 15.0
Loading...
Searching...
No Matches

Global python scripting context. More...

#include <cvb/py_script/context.hpp>

Inherits enable_shared_from_this< Context >.

Public Member Functions

ObjectPtr Eval (const Cvb::String &fileName, const Cvb::String &code)
 Compiles and evaluates python code-.
 
ObjectPtr Import (const Cvb::String &moduleName)
 Imports a python module.
 
ObjectPtr Item (const Cvb::String &itemName)
 Get an item from this context.
 
void AppendToSysPath (const Cvb::String &path)
 Adds additional items to the python search path.
 
struct InterpreterVersion InterpreterVersion () const noexcept
 Get the found interpreter version.
 
void * Handle () const noexcept
 Classic API buffer handle.
 

Static Public Member Functions

static ContextPtr CreateOrGet ()
 Creates a context.
 

Detailed Description

Global python scripting context.

The context is a process global singleton. It can only be created once.

Attention
There may be different wrapped instances due to different compilation units, but the actual context will still be a singleton living in the CVPyScript module.

Member Function Documentation

◆ Handle()

void * Handle ( ) const
inlinenoexcept

Classic API buffer handle.

Returns
Classic API handle.

It is normally not necessary to work with this handle.