On 04Jun2015 10:20, M2 <mohan.mo...@gmail.com> wrote:
Awesome Cameron.
It works the way I want it to work.

Glad to hear it. A few small remarks:

Thanks a lot guys.
Here is the new code:
[...]
from thread import start_new_thread

You're not using this any more. You may want to tidy this up.

def proc(col) :
       P=subprocess.Popen(col, shell=True)
       return

You are not returning P. But ...

       co=str("ssh -B ")+ str(com2) + str(com3)
       P=proc(co)

Here you are saving the return value as P (local to this function). My suggestion, I know. The point here is that in later code you might save all the P values and call P.wait() for them at some point after the loop, waiting for them to terminate. Or you may not care. Your call.

f.close()

Consider adding the suggested "with" form. Shorter, easier to read, more reliable.

Cheers,
Cameron Simpson <c...@zip.com.au>

Ride fast
Die fast
Leave no usable organs
       - Tom Warner <t...@dfind.demon.co.uk>
--
https://mail.python.org/mailman/listinfo/python-list

Reply via email to