How to disable output messages of the child process, in spawnv( )?

nushin nushin2 at
Thu Jul 24 03:56:28 CEST 2003

Is there any trick to disable the output of a child process spawned by
spawnv( ) API?

I believe in Python and i am sure there's a way around it. Correct me
if i am wrong.

Nushin (BB)

grante at (Grant Edwards) wrote in message news:<3f1eddc9$0$160$a1866201 at>...
> In article <db3b6d24.0307231050.74d41e66 at>, nushin wrote:
> > I'd like to disable the output of the process spawned by spawnv( )
> > API, but the catch is that i *have to* see the output of the parent
> > process making the  spawnv( ) call. Has anyone done that? I have some
> > pointers that by using dup2( ) API i might be able to do that, any
> > ideas how? Also, i have to spawn as an asynch call, using P_NOWAIT,
> > e.g.,:
> > 
> > os.spawnv(os.P_NOWAIT,'/usr/bin/python',('python',''),('>/dev/null &'))
> Nope.  
> The ">" and "&" are things that a shell (like bash or ksh)
> handles.  The python interpreter has no idea what to do with
> them.  If you want to use ">" and "&", then spawn a shell, and
> pass it a command to run the python program with output
> redirected.

More information about the Python-list mailing list