How to import static class (or static method) into IronPython (or DLR) using C# code(not python)?
-
18-09-2019 - |
Question
scope.SetVariable("math", ?? typeof(System.Math) ??);
or do I need create a module?
Solution
You can do:
scope.SetVariable("math", DynamicHelpers.GetPythonTypeFromType(typeof(System.Math)));
DynamicHelpers is in IronPython.Runtime.Types.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow