On 06/06/12 20:33, dohoang4...@comcast.net wrote:
i am writing a python script that will be invoked as follows:

cmd_line = Popen(["egrep", "(x,y)", aLogFile], stdout=PIPE, stdin=PIPE,
stderr=STDOUT)

Assuming you really want to use egrep, why?
You could process the file directly in Python searching for your strings (using the re module if need be).

Using Popen makes sense if the command is doing a lot of work or is very CPU intensive. But for file processing its probably as easy to just use Python to scan the log files directly.

But if you are really doing something more complex I see that others have answered the Popen() question...


--
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/

_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to