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"
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
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/
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
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
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
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