Re: [Tutor] subprocess Popen PIPE error

2010-10-26 Thread Abhijeet Rastogi
Ya. Do it using python. Why do you want to use bash when you already have python? See, do something like this:- import os alldirs = os.listdir("/path/to/dir") DIRS = [] #Only the dirs you are interested in for i in alldirs: if i.find("deploy") is -1: L.append(i) if i.find("TEMPLATE"

Re: [Tutor] subprocess Popen PIPE error

2010-10-26 Thread Abhijeet Rastogi
Please read the documentation of Popen. You cannot pass arguments like that. >>> from subprocess import Popen,PIPE >>> import shlex >>> cmd="ls -l" >>> cmd=shlex.split(cmd) >>> p = Popen(cmd,stdout=PIPE,stderr=PIPE) or simply that means >>> p = Popen(['ls','-l'],stdout=PIPE,stderr=PIPE) Hope I

[Tutor] subprocess Popen PIPE error

2010-10-26 Thread Sean Carolan
What am I doing wrong here? >>> from subprocess import Popen, PIPE >>> cmd = 'ls -l' >>> p = Popen(cmd, stdout=PIPE, stderr=PIPE) Traceback (most recent call last): File "", line 1, in ? File "/usr/lib64/python2.4/subprocess.py", line 550, in __init__ errread, errwrite) File "/usr/lib64/

Re: [Tutor] subprocess Popen

2009-04-03 Thread Tiago Saboga
On Fri, Apr 03, 2009 at 03:12:08PM -0700, Weidner, Ronald wrote: > I have a long running py script that I'm trying to kick off from > another long running py script as a separate process... If either > script fails or terminates, I don't want the other script to be > effected as a result. In other

[Tutor] subprocess Popen

2009-04-03 Thread Weidner, Ronald
I have a long running py script that I'm trying to kick off from another long running py script as a separate process... If either script fails or terminates, I don't want the other script to be effected as a result. In other words I need a separate process not a new thread. In any case, this co

[Tutor] subprocess Popen

2009-04-03 Thread Weidner, Ronald
I have a long running py script that I'm trying to kick off from another long running py script as a separate process... If either script fails or terminates, I don't want the other script to be effected as a result. In other words I need a separate process not a new thread. In any case, this co

[Tutor] Subprocess popen problem depending on how I start program

2007-01-16 Thread pytutor . 20 . 247ob
Hi, I'm writing a program that downloads audio streams from the net, to do this I use mplayer and tcpdump, which I kick off as detached processes (if thats the correct terminology), I do it this way because i'm using pygtk and I dont want the program to wait for the processes to finish otherwise th