I have following code:
m_pyScope = pyRuntime.UseFile(filename);
To load script file within IronPython runtime in C#.
The problem is that i need to register my custom functions, variables, etc to that scope, BEFORE executing this script. Code which i use now executes script body after compile.
Is there a way to make loading IronPython script like this:
- Compile from file or text variable
- Create empty scope (from Engine's createScope())
- Do something with that scope, for example add some function
- Execute script body, e.g. code which is outside any function or class