How to get the output from start proccess Utility
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
21-05-18 04:17 PM
Hi ,
I am running my python program using Utility-Environment, but i want to store the output of that program in a datatime.
Could you please assist with the steps to do that, i have tried adding an output variable in start process utility but it didnt worked.
Regards,
Navatha
2 REPLIES 2
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
21-05-18 07:52 PM
You will have to create a separate Business Object for the IDLE that you are using to run the python script.
Another option is that you could modify your python script to generate a txt file with the output, and then use Blue Prism to read that file.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
22-05-18 01:26 PM
Try pasting this into a code stage. The inputs are in bold.
Dim p As System.Diagnostics.Process
Dim s As System.Diagnostics.ProcessStartInfo
Dim r As System.IO.StreamReader
If Arguments"""" Then
s = New System.Diagnostics.ProcessStartInfo(Application, Arguments)
Else
s = New System.Diagnostics.ProcessStartInfo(Application)
End If
If Working_Folder"""" Then
s.WorkingDirectory = Working_Folder
End If
s.UseShellExecute = False
s.RedirectStandardOutput = True
s.createNoWindow = True
p = New System.Diagnostics.Process()
p.StartInfo = s
p.Start()
r = p.StandardOutput
If Time_Out>0 AndAlso p.WaitForExit(1000*Time_Out)=False Then
Throw New System.Exception(""Failed waiting for application to end"")
End If
Output = r.ReadToEnd()
