Replace current process with invocation of subprocess?

前端 未结 1 1588
说谎
说谎 2020-12-20 11:09

In python, is there a way to invoke a new process in, hand it the same context, such as standard IO streams, close the current process, and give control to the invoked proce

相关标签:
1条回答
  • 2020-12-20 11:56

    You may be interested in os.execv() and friends:

    These functions all execute a new program, replacing the current process; they do not return. On Unix, the new executable is loaded into the current process, and will have the same process id as the caller. Errors will be reported as OSError exceptions.

    0 讨论(0)
提交回复
热议问题