Python script execution


#1

How can I execute python script in Automation studio?
I tried giving it as WindowsApp and giving exe path with addition parameters, but not able to execute.

it takes time Setting up environment and doesn’t proceed further.


#2

Hi,

It is not possible to execute python script in Automation Studio as of now.

Regards,
Amit


#3

Dear User,
The feature to execute python scripts is currently WIP. It will be available in next release of Community Edition.


#4

Iron python can be used to run python script for a micronbot. This bot can be used in Automation studio. I could achieve it.


#5

Hi Abhijit,

If possible kindly post your reference code here for other to follow

Regards,
Amit


#6

Here goes the sample code in a microbot:

public class EmailClassification : IAECodePackage
{
public void Execute(StudioContext context)
{
Process p = new Process();
string fileName = string.Format(PythonInputfilename);
p.StartInfo.FileName = PythonEXEPath; //Python.exe location
p.StartInfo.RedirectStandardOutput = true;
p.StartInfo.UseShellExecute = false;
p.StartInfo.Arguments = fileName; // start the python program with two parameters
p.Start();
StreamReader s = p.StandardOutput;
output = s.ReadToEnd();
}
}

Reference to use IronPython on C# studio is mentioned below: