calling a program without waiting for it to finish

mnietz okumee at compuserve.de
Thu Mar 20 17:17:51 CET 2003


Peter Hansen <peter at engcorp.com> wrote in message news:<3E75D5E4.7E44DF6C at engcorp.com>...
> mnietz wrote:
> > 
> > Hey Guys,
> > 
> > I looking for a way to execute a command-line programm from Pyhton
> > without having to wait for it to finish.
> > AFAIK i can't use os.popen() or os.system() because these methods wait
> > for a return-value. Or can I use the unix command exec in way like
> > start in windows os.system("start ping -t www.google.com")?
> > That does exactly what i need.
> 
> Under Linux, appending an ampersand to the end of the command should
> do roughly what you want, shouldn't it?
> 
>   os.system("ping -blah -blah www.google.com &")
> 
> (Of course, pinging something without checking the return value 
> sounds pretty much useless to me, but maybe you were just giving
> a contrived example.)
> 
> -Peter

Adding an ampersand seems to work fine. Can you tell me what exactly it does?

Thanks,
mnietz




More information about the Python-list mailing list