Instantiating custom C# classes from IronPython

后端 未结 1 1617
再見小時候
再見小時候 2021-01-01 00:23

Is there any way to make a class available to IronPython scripts so that I can create objects inside the code?

For example, if I have a class that I want to be able

相关标签:
1条回答
  • 2021-01-01 01:16

    Assuming MyClass is in MyAssembly.dll:

    import clr
    clr.AddReference('MyAssembly.dll')
    import MyClass
    obj = MyClass("Hello, World!")
    obj.Write()
    
    0 讨论(0)
提交回复
热议问题