Reputation: 325
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:
Upvotes: 1
Views: 4424
Reputation: 325
I found the solution. The best way to load script is in answer to this question:
IronPython integration in C#: a specific problem/question
Create engine from runtime, then scope, then compile source. After that you can call source.Execute(scope) to execute script in scope created before
Upvotes: 4