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()
>
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
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
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,
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
Agreeing with the other poster that it's probably not the best way to handle it.
But for the sake of helping with subprocess:
https://docs.python.org/3.7/library/subprocess.html#popen-objects
Popen Objects don't have read() as the error says. That's on their .stdout and
.stderr streams. So you'd
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