public static bool testIronPython(string scriptToExecute, string expectedDataReceived) { var IronPythonExecution = new IronPythonShell(); var dataReceived = IronPythonExecution.executeScript(scriptToExecute); return(dataReceived == expectedDataReceived); }
public static Process startIronPythonShell(DataReceivedEventHandler dataReceivedCallBack) { var jythonShell = new IronPythonShell(); jythonShell.startIronPythonShell(dataReceivedCallBack); return(jythonShell.ironPythonProcess); }
// if we pass a callback for logging we need to start a python shell public static Process executePythonFile(string fileToExecute, DataReceivedEventHandler dataReceivedCallBack) { var ironPythonShell = new IronPythonShell(); ironPythonShell.startIronPythonShell(dataReceivedCallBack, fileToExecute); return(ironPythonShell.ironPythonProcess); }
public void testIronPythonScriptExecution() { var expectedDataReceived = "5" + Environment.NewLine; Assert.That(IronPythonInstall.checkIronPythonInstallation(), "checkIronPythonInstallation return false"); Assert.That(IronPythonShell.testIronPython("print 2+3", expectedDataReceived), "testIronPython failed"); Assert.That(false == IronPythonShell.testIronPython("print 2+3", "4"), "testIronPython should had failed"); var scriptToExecute = "print 2+3"; var tempPyScript = DI.config.getTempFileInTempDirectory("py"); Files.WriteFileContent(tempPyScript, scriptToExecute); var dataReceived = new IronPythonShell().executePythonFile(tempPyScript, ""); Assert.That(dataReceived == expectedDataReceived, "data received did no match expectedDataReceived"); File.Delete(tempPyScript); }
public static bool testIronPython(string scriptToExecute, string expectedDataReceived) { var IronPythonExecution = new IronPythonShell(); var dataReceived = IronPythonExecution.executeScript(scriptToExecute); return dataReceived == expectedDataReceived; }
public static Process startIronPythonShell(DataReceivedEventHandler dataReceivedCallBack) { var jythonShell = new IronPythonShell(); jythonShell.startIronPythonShell(dataReceivedCallBack); return jythonShell.ironPythonProcess; }
// if we pass a callback for logging we need to start a python shell public static Process executePythonFile(string fileToExecute, DataReceivedEventHandler dataReceivedCallBack) { var ironPythonShell = new IronPythonShell(); ironPythonShell.startIronPythonShell(dataReceivedCallBack, fileToExecute); return ironPythonShell.ironPythonProcess; }
public static void openIronPythonShellOnCmdExe() { IronPythonShell.openIronPythonShellOnCmdExe(); }