Stefan Jarina
Stefan Jarina

Reputation: 800

Execute external command, exit script and interact with external command

Is there any alternative to Perl's exec(); in Python?

I need Python to call external command, kill itself, and I can then interact with external command.

In Perl I can just call exec("command argument");

I was trying to achieve this with the subprocess module, but it seems I'm missing something. If I call subprocess.call, I can interact with child process, but parent is still running. If I run subprocess.Popen, the child is killed as soon as the parent exits.

Upvotes: 0

Views: 476

Answers (1)

Fred Foo
Fred Foo

Reputation: 363567

The family of os.exec* functions do this.

Upvotes: 2

Related Questions