Boost logo

Boost :

Subject: Re: [boost] Boost.Python sandox or multiple interpreters
From: David Bellot (david.bellot_at_[hidden])
Date: 2017-01-13 12:46:08


>
> > - or encapsulate each plugin in an independent "environment" ?
>
> Hard to tell without knowing these plugins. Right now it sounds like
> that's a question only you can answer. :-)
>

​The plugins are quite simple in fact:

The Python code define a few functions like

def on_value_update(​x):
   blah blah blah
   return foobar

and they can have global variables (if it's a problem I can forbid user's
to use those global variables in their plugins).

Each plugin is defined in a .py file and at runtime I load all those files,
one after each other.

I was reading about "scope" but I'm not sure from the documentation if it's
the right solution.
Can I load each of my Python files with all their functions and variables
into such a "scope" and switch from one scope to another depending on the
plugin I want to use ?


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk