[Tutor] system call

Alan Gauld alan.gauld at btinternet.com
Sun Oct 28 10:09:10 CET 2007


"Eric Walker" <sli1que at yahoo.com> wrote

> 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 

Have you considered just using the Unix time command?

> So, to time the entire init process, I want to use python. 

As an exercise its fair enough, but the OS time command
is probably just as effective for this kind of task.

Reimplementing standard OS tools can be a great learning tool
so if that is your aim, carry on with it. The os.system route 
(or subprocess.call) should be fine for what you need.

HTH,


-- 
Alan Gauld
Author of the Learn to Program web site
http://www.freenetpages.co.uk/hp/alan.gauld



More information about the Tutor mailing list