5

scope.SetVariable("math", ?? typeof(System.Math) ??);

还是我需要创建一个模块?

4

1 回答 1

7

你可以做:

scope.SetVariable("math", DynamicHelpers.GetPythonTypeFromType(typeof(System.Math)));

DynamicHelpers 在 IronPython.Runtime.Types 中。

于 2009-08-19T17:20:49.390 回答