[英]How to import static class (or static method) into IronPython (or DLR) using C# code(not python)?
scope.SetVariable("math", ?? typeof(System.Math) ??); scope.SetVariable(“ math”,?? typeof(System.Math)??);
or do I need create a module? 还是我需要创建一个模块?
You can do: 你可以做:
scope.SetVariable("math", DynamicHelpers.GetPythonTypeFromType(typeof(System.Math))); scope.SetVariable(“ math”,DynamicHelpers.GetPythonTypeFromType(typeof(System.Math)));;
DynamicHelpers is in IronPython.Runtime.Types. DynamicHelpers在IronPython.Runtime.Types中。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.