[Python.NET] Embedding: finer control over module creation

"Tom Unger (eVigils)" <[email protected]> Fri, 27 Apr 2018 17:06:35 +0000
Newsgroups gmane.comp.python.dotnet
Message-ID <BN6PR19MB097948321ABC51E2448C2F79C18D0@BN6PR19MB0979.namprd19.prod.outlook.com>
I'm starting on a project to embed CPython into a .NET application for scripting.  The application currently uses IronPython, which is falling behind.  Our scripting needs are fairly extensive and I'm challenged by the limited information I find available.  First questions are about some finer grain control over

First, my application loads a number of scripts.  I currently use PythonEngine.ModuleFromString() and this works but I would like finer control.


  1.  Set the filename in call to Py_CompileString().  Current this is set to "none"
  2.  Set globals for module before executing it.  I put certain values in the scripts global space for convenience.

PythonEngine.Compile() will compile the code but then I don't see any way to execute the code.  Runtime.PyImport_ExecCodeModule(name, c); is not public.

Is there a way to do this with the current API?

If I fork the GIT repo, make changes that I need, are they likely to be incorporated?

Thanks,

Tom

_________________________________________________
Python.NET mailing list - [email protected]
https://mail.python.org/mailman/listinfo/pythondotnet