C# 调用 python脚本
2017-01-27 00:00
155 查看
C# 调用 python脚本
pythondef welcome(name): return "Hello '" + name + "' from IronPython"
csharp
using System; using IronPython.Hosting; using Microsoft.Scripting.Hosting; namespace PythonSample { class Program { static void Main(string[] args) { Console.WriteLine("Loading helloworld.py..."); ScriptRuntime py = Python.CreateRuntime(); dynamic helloworld = py.UseFile("helloworld.py"); Console.WriteLine("helloworld.py loaded!"); for (int i = 0; i < 1000; i++) { Console.WriteLine(helloworld.welcome("Employee #{0}"), i); } Console.ReadLine(); } } }
相关文章推荐
- C#调用Python 脚本语言
- C#调用Python脚本的简单示例
- 在C#中调用python脚本,并使用python第三方arcpy模块
- C#调用python脚本
- 使用C#调用Python脚本,带参数列表 z
- C#中调用python脚本语言
- 在VS2017中用C#调用python脚本
- C#如何调用Python执行脚本,并将执行结果显示值显示至C#界面
- C#调用Python脚本并使用Python的第三方模块
- C#调用Python脚本并使用Python的第三方模块
- C# 调用批python 脚本
- 在.Net Framework中调用Python的脚本方法 (以VB和C#为例)
- 【转】C#中调用python脚本
- C#调用Python脚本的简单示例
- 【.NET调用Python脚本】C#调用python requests类库报错 'module' object has no attribute '_getframe' - IronPython 2.7
- C# 调用 python脚本
- C#调用Python脚本并使用Python的第三方模块
- IronPython脚本调用C#实现的dll库
- C#调用Python脚本并使用Python的第三方模块
- Python脚本调用C#代码数据交互示例(hello world)