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


Groups > comp.lang.python > #38547

Re: Spawn a process, then exit, whilst leaving process running?

Path csiph.com!usenet.pasdenom.info!news.albasani.net!newsfeed.straub-nv.de!dedekind.zen.co.uk!zen.net.uk!hamilton.zen.co.uk!reader03.nrc01.news.zen.net.uk.POSTED!not-for-mail
From Nobody <nobody@nowhere.com>
Subject Re: Spawn a process, then exit, whilst leaving process running?
Date Sun, 10 Feb 2013 03:50:07 +0000
User-Agent Pan/0.14.2 (This is not a psychotic episode. It's a cleansing moment of clarity.)
Message-Id <pan.2013.02.10.03.50.06.617000@nowhere.com>
Newsgroups comp.lang.python
References <39ae6b0f-339e-4e50-8cb0-4c020c6aff76@googlegroups.com>
MIME-Version 1.0
Content-Type text/plain; charset=UTF-8
Content-Transfer-Encoding 8bit
Lines 18
Organization Zen Internet
NNTP-Posting-Host 0dc20bd6.news.zen.co.uk
X-Trace DXC=k0`]ghFUldomQ\VPknk<Hif2FgniPJjgb=dR0\ckLKG`WeZ<[7LZNRfOaQ[gJo>d4nM2Z^cWRFGAkoXLN8NMNR6g
X-Complaints-To abuse@zen.co.uk
Xref csiph.com comp.lang.python:38547

Show key headers only | View raw


On Fri, 08 Feb 2013 21:04:33 -0800, Victor Hooi wrote:

> I have a Python script that I'd like to spawn a separate process (SSH
> client, in this case), and then have the script exit whilst the process
> continues to run.
> 
> I looked at Subprocess, however, that leaves the script running, and it's
> more for spawning processes and then dealing with their output.
> 
> Somebody mentioned multiprocessing, however, I'm not sure quite sure how
> that would work here.
> 
> What's the most Pythontic way of achieving this purpose?

On Unix, the os.exec* functions might be appropriate, depending upon
whether the script needs to do anything afterwards. Otherwise, use
subprocess.Popen().

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


Thread

Spawn a process, then exit, whilst leaving process running? Victor Hooi <victorhooi@gmail.com> - 2013-02-08 21:04 -0800
  Re: Spawn a process, then exit, whilst leaving process running? Nobody <nobody@nowhere.com> - 2013-02-10 03:50 +0000

csiph-web