[英]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”,DynamicHelpers.GetPythonTypeFromType(typeof(System.Math)));;
DynamicHelpers在IronPython.Runtime.Types中。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.