在C中从ironpython调用第三方模块python函数#

2024-09-27 17:30:36 发布

您现在位置:Python中文网/ 问答频道 /正文

我必须从c#调用textfsm python模块函数。 我用的是铁蟒。你知道吗

当前代码

        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代码后这是怎么回事传递模板并获取输出。你知道吗


Tags: 模块函数代码varlibsitefilesprogram

热门问题