locked
Pausing for the duration of a script RRS feed

  • Question

  • I've written a program in C# that calls a python script. Right now, I just have the C# program pause for 5 secs while the python script runs, but I was wondering if there's any way for me to pause the C# script for only the amount of time that the python script is running
    Sunday, July 31, 2011 4:11 PM

Answers

  • Hi,

    And how do you lauch your script ? If using the Process class you have a WaitForExit method that should wait until the scripts end.


    Please always mark whatever response solved your issue so that the thread is properly marked as "Answered".
    Sunday, July 31, 2011 4:45 PM

All replies

  • Hi,

    And how do you lauch your script ? If using the Process class you have a WaitForExit method that should wait until the scripts end.


    Please always mark whatever response solved your issue so that the thread is properly marked as "Answered".
    Sunday, July 31, 2011 4:45 PM
  • I like trying to answer some of these forum posts by researching them on the internet. This was one of those that I wanted to know the answer to as well. I've seen and heard of ways to do this with Threading but I am not real familiar with threading. I did, however, stumble upon this link, http://msdn.microsoft.com/en-us/library/95hbf2ta.aspx.

    I copied and pasted the code and ran it in debug with a breakpoint just into the Main() method to see how it worked. I'm not sure if this is something that you are looking for or not as a solution but I would think it would work pretty well in your case. It will wait for one thread to execute before continuing with the main thread.


    Chris "Is there anything besides programming?"
    Monday, August 1, 2011 1:09 PM