On Thu, 16 Dec 2004 03:00:45 GMT, Lingyun Yang <[EMAIL PROTECTED]> wrote:
>Hi,
>
> I want to use python as a "shell like" program,
> and execute an external program in it( such as mv, cp, tar, gnuplot)
> I tried:
>
> os.execv("/bin/bash",("/usr/bin/gnuplot",'-c "gnuplot < plot.tmp"'))
>
> since it's in a for-loop, it should be executed many times, but
> It exits after the first time running.
http://www.die.net/doc/linux/man/man3/execv.3.html
Note in particular this line:
The exec family of functions replaces the current process image with a new
process image.
So the program is doing exactly what you asked it to. If you want to run
multiple things, os.execv() is probably not for you.
Jp
--
http://mail.python.org/mailman/listinfo/python-list