Hi, thanks for looking at mu question. I am running a python script from within a vb.net application in ArcMap. The script is called and creates a database, currently I run the script, visually check to see that the database is created then I run the next part of the application. What I want to do is to eliminate me having to check to see that the database is created, so that when the python script ends the next part of the process can continue on from code.
So is there someway I can halt the VB.net code from executing until the python script is done. What happens is if I try this is that the code fires off the python script and the VB.net code continues on before the database is created.
Thanks for your time. Dale,
Solved! Go to Solution.
you should be able to use process.WaitForExit or use the Process.Exited Event like:
Private Sub myProcess_Exited(ByVal sender As Object, _
ByVal e As System.EventArgs) Handles myProcess.Exited
eventHandled = True
Console.WriteLine("Exit time: {0}" & vbCrLf & _
"Exit code: {1}" & vbCrLf & "Elapsed time: {2}", _
myProcess.ExitTime, myProcess.ExitCode, elapsedTime)
End Sub
See:
Process.Exited Event (System.Diagnostics)
or
you should be able to use process.WaitForExit or use the Process.Exited Event like:
Private Sub myProcess_Exited(ByVal sender As Object, _
ByVal e As System.EventArgs) Handles myProcess.Exited
eventHandled = True
Console.WriteLine("Exit time: {0}" & vbCrLf & _
"Exit code: {1}" & vbCrLf & "Elapsed time: {2}", _
myProcess.ExitTime, myProcess.ExitCode, elapsedTime)
End Sub
See:
Process.Exited Event (System.Diagnostics)
or
Thanks Paul, I do appreciate it. Now I am past that, but back to a prior VB.net-Python issue. I will posting it in a minute. Dale,