I got the impression the API as exposed cleanly by Python.NET is missing some of the pieces I needed to do this. Imagine I have some scripts I want to run to set up the global namespace with a bunch of context, and then I want to interact with the interpreter with that context set up. This can come from trying to run scripts inside of it, run strings of Python commands inside of it, or poke and prod it from the .NET side (specifically C# FWIW). I tried to acquire the "name" module but that came back with a null PyObject, so I suspect there's a little more to this.
My impression is the C API does expose all this, although it's pretty far from clear. It has been awhile since I looked at it directly; a year ago I was having fun embedding Python in C++. From what I can recall, there's usually a dictionary containing all the gunk in the namespace, and I can go torment that if I wanted to play with things. IIRC IronPython (at least at points) has had a script scope or something else containing a context for the current interpreter. Does the current Python.NET API expose something like this?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I got the impression the API as exposed cleanly by Python.NET is missing some of the pieces I needed to do this. Imagine I have some scripts I want to run to set up the global namespace with a bunch of context, and then I want to interact with the interpreter with that context set up. This can come from trying to run scripts inside of it, run strings of Python commands inside of it, or poke and prod it from the .NET side (specifically C# FWIW). I tried to acquire the "name" module but that came back with a null PyObject, so I suspect there's a little more to this.
My impression is the C API does expose all this, although it's pretty far from clear. It has been awhile since I looked at it directly; a year ago I was having fun embedding Python in C++. From what I can recall, there's usually a dictionary containing all the gunk in the namespace, and I can go torment that if I wanted to play with things. IIRC IronPython (at least at points) has had a script scope or something else containing a context for the current interpreter. Does the current Python.NET API expose something like this?