示例#1
0
        public void Execute(IUBotStudio ubotStudio, Dictionary <string, string> parameters)
        {
            try
            {
                string pythonFile     = Path.GetFullPath(parameters["PythonFile"]);
                string pythonCompiler = Path.GetFullPath(parameters["PythonCompiler"]);

                //Check for python compiler
                if (File.Exists(pythonCompiler))
                {
                    if (File.Exists(pythonFile))
                    {
                        this._returnValue = pinfo.ExecutePython(pythonCompiler, pythonFile, true);
                    }
                    else
                    {
                        this._returnValue = "Python file specified doesn't exists";
                    }
                }
                else
                {
                    this._returnValue = "Python compiler specified doesn't exists";
                }
            }
            catch (Exception exception)
            {
                this._returnValue = exception.Message;
            }
        }