Re: subprocess : AttributeError: 'Popen' object has no attribute 'read'

2019-01-04 Thread Peter Otten
Mohan Mohta wrote: > Hello, > I am trying to grep the keyword (which I got from report_file ) from > report_file > > I tried multiple ways but am unable to get it to work. > > Below are the methods I tried. > > > fp=open(txt_file,'r') > for line in fp : > line=line.strip() >

Re: subprocess : AttributeError: 'Popen' object has no attribute 'read'

2019-01-04 Thread Chris Angelico
On Fri, Jan 4, 2019 at 10:16 PM wrote: > > On Thursday, January 3, 2019 at 9:40:43 PM UTC+1, Chris Angelico wrote: > > On Fri, Jan 4, 2019 at 7:37 AM Mohan Mohta wrote: > > > I am no expert in python but I found grep is lot faster in than the > > > methods of reading files from python point

Re: subprocess : AttributeError: 'Popen' object has no attribute 'read'

2019-01-04 Thread marco . nawijn
On Thursday, January 3, 2019 at 9:40:43 PM UTC+1, Chris Angelico wrote: > On Fri, Jan 4, 2019 at 7:37 AM Mohan Mohta wrote: > > I am no expert in python but I found grep is lot faster in than the methods > > of reading files from python point me to direction if you know of > > anything faste

Re: subprocess : AttributeError: 'Popen' object has no attribute 'read'

2019-01-03 Thread Chris Angelico
On Fri, Jan 4, 2019 at 7:37 AM Mohan Mohta wrote: > I am no expert in python but I found grep is lot faster in than the methods > of reading files from python point me to direction if you know of > anything faster I would appreciate it. > Try doing things the simple and easy way in Python,

Re: subprocess : AttributeError: 'Popen' object has no attribute 'read'

2019-01-03 Thread Mohan Mohta
On Thursday, January 3, 2019 at 1:49:31 PM UTC-6, Chris Angelico wrote: > On Fri, Jan 4, 2019 at 6:46 AM Mohan Mohta wrote: > > > > Hello, > > I am trying to grep the keyword (which I got from report_file ) from > > report_file > > > > I tried multiple ways but am unable to get it to work. > > H

RE: subprocess : AttributeError: 'Popen' object has no attribute 'read'

2019-01-03 Thread David Raymond
n-list [mailto:python-list-bounces+david.raymond=tomtom@python.org] On Behalf Of Mohan Mohta Sent: Thursday, January 03, 2019 2:44 PM To: python-list@python.org Subject: subprocess : AttributeError: 'Popen' object has no attribute 'read' Hello, I am trying to grep the keyword (w

Re: subprocess : AttributeError: 'Popen' object has no attribute 'read'

2019-01-03 Thread Chris Angelico
On Fri, Jan 4, 2019 at 6:46 AM Mohan Mohta wrote: > > Hello, > I am trying to grep the keyword (which I got from report_file ) from > report_file > > I tried multiple ways but am unable to get it to work. How about, instead, you simply open the file and iterate through it, looking for the keywor

subprocess : AttributeError: 'Popen' object has no attribute 'read'

2019-01-03 Thread Mohan Mohta
Hello, I am trying to grep the keyword (which I got from report_file ) from report_file I tried multiple ways but am unable to get it to work. Below are the methods I tried. fp=open(txt_file,'r') for line in fp : line=line.strip() var1=line.lower() g_info=subprocess