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 multip

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()

Re: xlsxwriter considering worksheet.write as tuple ???

2016-09-26 Thread Mohan Mohta
of notes on style: the terminating semicolons in your code > is unnecessary. It's only needed for multiple statements on a single line. > Please use a single space on each side of a binary operator or assignment - > it improves readability. > > Regards, > > On Mon, Sep 26, 201

Re: xlsxwriter considering worksheet.write as tuple ???

2016-09-26 Thread Mohan Mohta
On Monday, September 26, 2016 at 8:08:13 PM UTC-5, MRAB wrote: > On 2016-09-27 01:34, Mohan Mohta wrote: > > On Monday, September 26, 2016 at 6:56:20 PM UTC-5, Nathan Ernst wrote: > >> On Mon, Sep 26, 2016 at 6:00 PM, MRAB <pyt...@mrabarnett.plus.com> wrote: > >&g

Re: xlsxwriter considering worksheet.write as tuple ???

2016-09-26 Thread Mohan Mohta
On Monday, September 26, 2016 at 6:56:20 PM UTC-5, Nathan Ernst wrote: > On Mon, Sep 26, 2016 at 6:00 PM, MRAB wrote: > > > On 2016-09-26 23:03, M2 wrote: > > > >> Hello > >> The program is designed to collect different statistics from servers > >> across the network

Multiple thread program problem

2015-06-03 Thread Mohan Mohta
Hello I am trying to create multiple thread through the below program but I am getting an error #! /usr/bin/python import os import subprocess import thread import threading from thread import start_new_thread def proc(f) : com1=ssh -B com2=line.strip('\n') com3=

Re: Multiple thread program problem

2015-06-03 Thread Mohan Mohta
On Wednesday, June 3, 2015 at 4:01:13 PM UTC-5, Sam Raker wrote: proc(f) isn't a callable, it's whatever it returns. IIRC, you need to do something like 'start_new_thread(proc, (f,))' If I execute something like t=thread.start_new_thread(proc,(f)) I get: Traceback (most recent call last):

Re: Multiple thread program problem

2015-06-03 Thread Mohan Mohta
On Wednesday, June 3, 2015 at 5:34:31 PM UTC-5, Waffle wrote: You think (f) makes a tuple, but it does not. the parentesis is not the tuple constructor, the comma is try: t=thread.start_new_thread(proc,(f,)) Thanks for the pointer waffle. The program executes now but still not the way I want