Re: [Tutor] Searching 2 Strings in A File

2012-06-06 Thread Alan Gauld
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 sea

Re: [Tutor] Searching 2 Strings in A File

2012-06-06 Thread Prasad, Ramit
Please respond back to the list (so others know what worked and that the problem is solved). :) > > hi all, > > thanks a lot for your quick response. > > Dave, actually it's a 2 arguments.  Sorry, i did not make it clear in my > question.  I used Ramit's hint and it worked.  The code should

Re: [Tutor] Searching 2 Strings in A File

2012-06-06 Thread Prasad, Ramit
> > x = "Device " + sys.argv[1] + " restored the database" > > y = "Created connection to " + sys.argv[1] > > > > cmd_line = Popen(["egrep", "(x,y)", aLogFile], stdout=PIPE, stdin=PIPE, > > stderr=STDOUT) > > > > the above code does not work because it will look for x and y in aLogFile

Re: [Tutor] Searching 2 Strings in A File

2012-06-06 Thread Prasad, Ramit
> x = "Device " + sys.argv[1] + " restored the database" > y = "Created connection to " + sys.argv[1] > > cmd_line = Popen(["egrep", "(x,y)", aLogFile], stdout=PIPE, stdin=PIPE, > stderr=STDOUT) > > the above code does not work because it will look for x and y in aLogFile > instead of

Re: [Tutor] Searching 2 Strings in A File

2012-06-06 Thread Dave Angel
On 06/06/2012 03:33 PM, dohoang4...@comcast.net wrote: > i am writing a python script that will be invoked as follows: > > myScript.py > > and the script is as follwos: > > x = "Device " + sys.argv[1] + " restored the database" > y = "Created connection to " + sys.argv[1] > > cmd_line = Popen

[Tutor] Searching 2 Strings in A File

2012-06-06 Thread dohoang4093
i am writing a python script that will be invoked as follows: myScript.py and the script is as follwos: x = "Device " + sys.argv[1] + " restored the database" y = "Created connection to " + sys.argv[1] cmd_line = Popen(["egrep", "(x,y)", aLogFile], stdout=PIPE, stdin=PIPE, stderr=STDOUT)