0

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.

  • OS is UNIX.
  • Python is 2.6.4 (can't install any module)

1 Answer 1

2

The family of os.exec* functions do this.

Sign up to request clarification or add additional context in comments.

1 Comment

Ah, I completely missed this one. Funny that I was checking os module. Ok thanks a lot guys, quick and nice help.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.