Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #49719

Re: Python - forking an external process?

Date 2013-07-03 12:55 +0200
From Antoon Pardon <antoon.pardon@rece.vub.ac.be>
Subject Re: Python - forking an external process?
References <14be21de-2ceb-464a-a638-dce0368ab9e7@googlegroups.com>
Newsgroups comp.lang.python
Message-ID <mailman.4160.1372848957.3114.python-list@python.org> (permalink)

Show all headers | View raw


Op 03-07-13 05:47, Victor Hooi schreef:
> Hi,
>
> I have a Python script where I want to run fork and run an external command (or set of commands).
>
> For example, after doing <xyz>, I then want to run ssh to a host, handover control back to the user, and have my script terminate.
>
> Or I might want to run ssh to a host, less a certain textfile, then exit.
>
> What's the idiomatic way of doing this within Python? Is it possible to do with Subprocess?
>

If I understand correctly that you want something done in python and then wish to finish
python and give control to an other program. I would use an external script that would
first launch the python program and then the other program.

If for some reason this is a less attractive option, you can use the os.exec family.
That terminates the python program will starting up an other program.

-- 
Antoon Pardon

Back to comp.lang.python | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

Python - forking an external process? Victor Hooi <victorhooi@gmail.com> - 2013-07-02 20:47 -0700
  Re: Python - forking an external process? rusi <rustompmody@gmail.com> - 2013-07-02 20:59 -0700
    Re: Python - forking an external process? Victor Hooi <victorhooi@gmail.com> - 2013-07-02 21:11 -0700
      Re: Python - forking an external process? rusi <rustompmody@gmail.com> - 2013-07-02 21:22 -0700
  Re: Python - forking an external process? Roy Smith <roy@panix.com> - 2013-07-03 00:17 -0400
  Re: Python - forking an external process? Antoon Pardon <antoon.pardon@rece.vub.ac.be> - 2013-07-03 12:55 +0200

csiph-web