
Hi devs, Can multiple PyPy sandboxes be executed and interacted with from C/C++? For context, I'm adding plugin support to my application. I'd like people to be able to write a python module, and call it's functions from the C/C++ in a sandboxed environment. This is for 2 reasons: 1) So that a plugin can't mess with the user's system 2) So that a plugin's access to other plugins can be controlled Cheers, Kit P.S. I'm currently using PyOtherSide in my Qt app, but I'm realising it may not be a good solution for plugins.

Hi Kit, On 24 June 2014 02:42, Kit Ham <kitizz.devside@gmail.com> wrote:
Can multiple PyPy sandboxes be executed and interacted with from C/C++?
Yes, you can in theory do whatever you want, but it is not really finished and documented. You first need to decide if it's ok that each sandbox runs in a separate process or if you would rather have an in-process solution (more work). In the first case, you'd extend the "controller" (regular Python code controlling the sandboxed subprocess) so that it can handle several subprocesses at once. Then, for example, you'd run the controller in CPython, and link to CPython from your C/C++ code using the standard CPython ways. Or you can even rewrite the controller in C/C++: it's just some code reading and writing to the subprocesses' stdin/stdout. (Each subprocess is one sandboxed PyPy instance.) A bientôt, Armin.

Hi Kit, On 24 June 2014 02:42, Kit Ham <kitizz.devside@gmail.com> wrote:
Can multiple PyPy sandboxes be executed and interacted with from C/C++?
Yes, you can in theory do whatever you want, but it is not really finished and documented. You first need to decide if it's ok that each sandbox runs in a separate process or if you would rather have an in-process solution (more work). In the first case, you'd extend the "controller" (regular Python code controlling the sandboxed subprocess) so that it can handle several subprocesses at once. Then, for example, you'd run the controller in CPython, and link to CPython from your C/C++ code using the standard CPython ways. Or you can even rewrite the controller in C/C++: it's just some code reading and writing to the subprocesses' stdin/stdout. (Each subprocess is one sandboxed PyPy instance.) A bientôt, Armin.
participants (2)
-
Armin Rigo
-
Kit Ham