En Tue, 20 Mar 2007 22:45:16 -0300, russ <[EMAIL PROTECTED]>  
escribió:

> Very new to Python - but excited to see what is possible - it sounds
> very suitable for a project of mine I need a little help with.
>
> I've got an executable which writes out data to stdout in a CSV sort
> of format - I'd like to grab the data from stdout and create stats
> from it at a regular interval, i.e. every 10 min.  Probably push the
> stats out to a CSV file.
>
> The popen2 module can read the stdout just like a file, and the csv
> module can handle the reading / writing.  How do I go about
> 'processing' the stdout every 10 min?

The executable is continuously writting data to stdout, right?
So your code will likely be reading that output inside a loop - just check  
using time.time() if the desired interval has elapsed.
Maybe you'd prefer using the subprocess module instead of popen2.

-- 
Gabriel Genellina

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to