Re: Playing with threads

2015-01-10 Thread Ganesh Pal
Thanks I read subprocess module this answered most of my question ,thanks a lot for the replies On Thu, Jan 8, 2015 at 9:46 AM, Terry Reedy wrote: > On 1/7/2015 9:00 PM, Ganesh Pal wrote: > >> Hi friends, >> >> I'm trying to use threads to achieve the below work flow >> >> 1. Start a process ,

Re: Playing with threads

2015-01-07 Thread Terry Reedy
On 1/7/2015 9:00 PM, Ganesh Pal wrote: Hi friends, I'm trying to use threads to achieve the below work flow 1. Start a process , while its running grep for a string 1 2. Apply the string 1 to the command in step 1 and exit step 2 3. Monitor the stdout of step1 and print success if the is patte

Re: Playing with threads

2015-01-07 Thread Chris Angelico
On Thu, Jan 8, 2015 at 1:00 PM, Ganesh Pal wrote: > I'm trying to use threads to achieve the below work flow > > 1. Start a process , while its running grep for a string 1 > 2. Apply the string 1 to the command in step 1 and exit step 2 > 3. Monitor the stdout of step1 and print success if the is

Re: Playing with threads

2015-01-07 Thread Dave Angel
On 01/07/2015 09:00 PM, Ganesh Pal wrote: Hi friends, I'm trying to use threads to achieve the below work flow 1. Start a process , while its running grep for a string 1 2. Apply the string 1 to the command in step 1 and exit step 2 3. Monitor the stdout of step1 and print success if the is pa

Re: Playing with threads

2015-01-07 Thread Devin Jeanpierre
I can't tell what you mean, but you can start a process via subprocess.Popen, do some work, and wait for it to finish. https://docs.python.org/2/library/subprocess.html Note that you don't need the stdout (or likely the stdin) of the process, you just need the return code -- whether or not grep su

Playing with threads

2015-01-07 Thread Ganesh Pal
Hi friends, I'm trying to use threads to achieve the below work flow 1. Start a process , while its running grep for a string 1 2. Apply the string 1 to the command in step 1 and exit step 2 3. Monitor the stdout of step1 and print success if the is pattern found Questions: 1. Can the above b