C#如何使用PythonTuple类型

示例代码:

new PythonTuple(new[] { 1, 2, 3 });

PythonTuple myTuple = PythonOps.MakeTuple(new object[] { 1, 2, 3 });

// IronPython.Runtime.List
List list = new List();
list.Add(1);
list.Add(2);
list.Add(3);
PythonTuple tuple = new PythonTuple(list);
foreach (int i in tuple)
{
    Console.WriteLine("Tuple item: {0}", i);
}

 

posted @ 2018-08-14 18:12  wzwyc  阅读(353)  评论(0编辑  收藏  举报