示例#1
0
 public string CallFunction(
     PythonFunction function,
     string argumentsBody
     )
 {
     return(PythonInterop.EvalToResult(string.Format("{0}.{1}({2})",
                                                     this.PyName, function.Function, argumentsBody
                                                     )).Value);
 }
示例#2
0
        public string CallFunction(
            PythonFunction function,
            List <object> arguments  = null,
            EscapeFlags escapeMethod = EscapeFlags.Quotes | EscapeFlags.StripNullItems
            )
        {
            if (arguments == null)
            {
                arguments = new List <object>();
            }

            List <string> textArguments = PythonInterop.EscapeArguments(arguments, escapeMethod);

            return(PythonInterop.EvalToResult(string.Format("{0}.{1}({2})",
                                                            this.PyName, function.Function, string.Join(", ", textArguments)
                                                            )));
        }