Build Python scripts and call methods from C#

后端 未结 2 753
南笙
南笙 2020-12-24 09:10

Is there any way to make this scenario work?

There is a Python script. It is built into a DLL by running this script with IronPython:

import clr
clr.         


        
2条回答
  •  悲&欢浪女
    2020-12-24 10:05

    The clr.CompileModules is purely a load-time optimization - it doesn't make the scripts directly available to a static languge like C#. You'll need to host the IronPython runtime, and then you can load the DLL into the runtime and use IronPython's hosting interfaces to access it.

提交回复
热议问题