Re: how to capture os.execvp into variable

2006-03-29 Thread Ben C
On 2006-03-28, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > hi > i am using this code to run a ps command in unix > > def run(program, *args): > pid = os.fork() > if not pid: > os.execvp(program, (program,) + args) > return os.wait()[0] > > run("ps", "-eo pid,ppid,args") > >

how to capture os.execvp into variable

2006-03-27 Thread s99999999s2003
hi i am using this code to run a ps command in unix def run(program, *args): pid = os.fork() if not pid: os.execvp(program, (program,) + args) return os.wait()[0] run("ps", "-eo pid,ppid,args") It runs fine, but i wish to store the results into a variablehow can i do thi