1

我必须从 c# 调用 textfsm python 模块函数。我为此使用 Ironpython。

当前代码

        ScriptEngine engine = Python.CreateEngine();
        var paths = engine.GetSearchPaths();
        string dir2 = @"C:\Program Files\Python37\Lib\site-packages";
        paths.Add(dir2); // change this path according to your IronPython installation
        engine.SetSearchPaths(paths);
        var scope = engine.CreateScope();
        var eng = engine.ExecuteFile(@"C:\Program Files\Python37\Lib\site-package\textfsm.py", scope);

在此之后我没有得到如何执行 textfsm 代码。如何传递模板并获取输出。

4

0 回答 0