<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:times new roman, new york, times, serif;font-size:12pt"><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;">Alan,<br>The problem is that I have another tool that has an initialization period when you start it up. I want to see how long it takes for it to start up or initialize. So, I set up the tool to startup and after it finishes the init stage, load up a file which has a custom procedure. Then run this custom procedure that executes an exit command. So, to time the entire init process, I want to use python. I first take a time stamp. Then execute the tool with os.system. Once it finishes, I take another time stamp. Subtract the two and get a general time of execution or init for the other program. What do you think?<br><br>python newbie...<br><br><br><br><br><div style="font-family: times new roman,new
 york,times,serif; font-size: 12pt;">----- Original Message ----<br>From: Alan Gauld &lt;alan.gauld@btinternet.com&gt;<br>To: tutor@python.org<br>Sent: Saturday, October 27, 2007 4:09:35 PM<br>Subject: Re: [Tutor] system call<br><br>
<br>"Eric Walker" &lt;<a ymailto="mailto:sli1que@yahoo.com" href="mailto:sli1que@yahoo.com">sli1que@yahoo.com</a>&gt; wrote <br><br>&gt; I am trying to run a timing script but I need the python program <br>&gt; to stop and wait for the executable to finish. Does anyone have <br>&gt; any examples of doing this?<br><br>There are several ways to do it depending on what exactly <br>you are trying to do. We need a bit more detail.<br><br>If the "timing script" is an externalo program then if you run <br>it using os.system() your code will wait(ie block) until system() <br>returms - which is when the program executed exits.<br><br>However os.system() is a bit of a blunt tool and <br>often not the best solution. If we know what the <br>real problem is we might do better.<br><br><br>-- <br>Alan Gauld<br>Author of the Learn to Program web site<br><a href="http://www.freenetpages.co.uk/hp/alan.gauld"
 target="_blank">http://www.freenetpages.co.uk/hp/alan.gauld</a><br><br>_______________________________________________<br>Tutor maillist&nbsp; -&nbsp; <a ymailto="mailto:Tutor@python.org" href="mailto:Tutor@python.org">Tutor@python.org</a><br><a href="http://mail.python.org/mailman/listinfo/tutor" target="_blank">http://mail.python.org/mailman/listinfo/tutor</a><br></div><br></div></div><br>__________________________________________________<br>Do You Yahoo!?<br>Tired of spam?  Yahoo! Mail has the best spam protection around <br>http://mail.yahoo.com </body></html>