subprocess equivalent for "os.execvp()"?

Eryk Sun eryksun at gmail.com
Sun Jan 8 11:22:33 EST 2023


On 1/8/23, c.buhtz at posteo.jp <c.buhtz at posteo.jp> wrote:
>
> is there an equivalent in the subprocess module for "os.execvp()" to
> replace the current process with the new called one?

A note for Windows users

Avoid using any of the `os.exec*` functions on Windows. There's no
support for replacing a Windows process image, so the `exec*()`
functions simply spawn a child process and terminate the current one.
This is a mess in general because a waiting parent isn't aware of the
spawned descendant. It's particularly bad for a console process that
inherits the console session, since two processes will try to use
console I/O simultaneously.


More information about the Python-list mailing list