Пример #1
0
 public void TestCompileExpression()
 {
     using (Py.GIL())
     {
         ps.Set("bb", 100); //declare a global variable
         ps.Set("cc", 10);  //declare a local variable
         PyObject script = PythonEngine.Compile("bb + cc + 3", "", RunFlagType.Eval);
         var      result = ps.Execute <int>(script);
         Assert.AreEqual(113, result);
     }
 }