Hi All, i was wondering if is there a way to receive the StdOut output continuously, i have a python script that I am running and i need to check the output every 1 second, the script runs for about 2 minutes, but I need to check the output every 1 second to validate the output information, is there a way to run the script and check it's output every 1 second, if so how would i go about doing this?
Sub Process_Globals
dim t as timer
end sub
Sub AppStart (Form1 As Form, Args() As String)
t.Initialize("Timer",500)
' ...
end sub
Sub btnGO_Click
Dim args As List
args.Initialize
'args.Add("-oF")
'args.Add("GTIFF")
args.Add("-o")
args.Add(lblDest.Text)
For Each item As String In lv.Items
args.Add(item)
Next
shl.Initialize("shl", "gdal_merge.bat" , args)
shl.WorkingDirectory = "C:\OSGeo4W64\"
shl.Run(-1) ' No timeout- Let it run...
running = True
t.Enabled = True ' Timer enabled
End Sub
Sub Timer_Tick
' change the content of the memo field with the new temporary output
If running Then
memo.Text = shl.GetTempOut
End If
End Sub
Sub shl_ProcessCompleted (Success As Boolean, ExitCode As Int, StdOut As String, StdErr As String)
t.Enabled = False
running = False
If Success And ExitCode = 0 Then
Log("Success")
Log(StdOut)
memo.Text = StdOut
Else
Log("Error: " & StdErr)
memo.Text = StdErr
End If
End Sub
Sub Process_Globals
dim t as timer
end sub
Sub AppStart (Form1 As Form, Args() As String)
t.Initialize("Timer",500)
' ...
end sub
Sub btnGO_Click
Dim args As List
args.Initialize
'args.Add("-oF")
'args.Add("GTIFF")
args.Add("-o")
args.Add(lblDest.Text)
For Each item As String In lv.Items
args.Add(item)
Next
shl.Initialize("shl", "gdal_merge.bat" , args)
shl.WorkingDirectory = "C:\OSGeo4W64\"
shl.Run(-1) ' No timeout- Let it run...
running = True
t.Enabled = True ' Timer enabled
End Sub
Sub Timer_Tick
' change the content of the memo field with the new temporary output
If running Then
memo.Text = shl.GetTempOut
End If
End Sub
Sub shl_ProcessCompleted (Success As Boolean, ExitCode As Int, StdOut As String, StdErr As String)
t.Enabled = False
running = False
If Success And ExitCode = 0 Then
Log("Success")
Log(StdOut)
memo.Text = StdOut
Else
Log("Error: " & StdErr)
memo.Text = StdErr
End If
End Sub