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


Groups > comp.lang.python > #4596

Re: Running and killing a process in python

Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!feeder.news-service.com!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <prologic@shortcircuit.net.au>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.002
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'wed,': 0.04; 'python?': 0.07; 'subject:process': 0.07; 'python': 0.07; 'subprocess': 0.09; 'to:name:python list': 0.09; 'am,': 0.14; 'wrote:': 0.14; 'subject:python': 0.15; '10:45': 0.16; '2.5)': 0.16; 'module:': 0.16; 'x64': 0.16; 'this?': 0.18; 'header:In-Reply-To:1': 0.22; 'trying': 0.23; 'script': 0.26; 'windows': 0.26; "i'm": 0.26; '(in': 0.27; 'message-id:@mail.gmail.com': 0.28; 'received:209.85.161': 0.29; 'hi,': 0.29; 'process,': 0.29; 'solved': 0.31; 'whats': 0.31; 'it.': 0.31; 'url:library': 0.31; 'to:addr:python-list': 0.32; 'url:docs': 0.33; 'module': 0.33; 'using': 0.34; 'doing': 0.36; 'received:209.85': 0.37; 'url:python': 0.37; 'received:google.com': 0.38; 'url:org': 0.38; 'to:addr:python.org': 0.39; 'received:209': 0.39; 'header:Received:5': 0.40; 'best': 0.60; '2011': 0.62; 'descendants': 0.84
MIME-Version 1.0
In-Reply-To <BANLkTi=kCto8wriosiGqPipYA_cE4AYTsg@mail.gmail.com>
References <BANLkTi=kCto8wriosiGqPipYA_cE4AYTsg@mail.gmail.com>
From James Mills <prologic@shortcircuit.net.au>
Date Wed, 4 May 2011 12:31:06 +1000
Subject Re: Running and killing a process in python
To python list <python-list@python.org>
Content-Type text/plain; charset=UTF-8
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.12
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.1139.1304476288.9059.python-list@python.org> (permalink)
Lines 19
NNTP-Posting-Host 82.94.164.166
X-Trace 1304476288 news.xs4all.nl 81484 [::ffff:82.94.164.166]:41014
X-Complaints-To abuse@xs4all.nl
Xref x330-a1.tempe.blueboxinc.net comp.lang.python:4596

Show key headers only | View raw


On Wed, May 4, 2011 at 10:45 AM, Astan Chee <astan.chee@gmail.com> wrote:
> Hi,
> I'm trying to make a python script (in windows 7 x64 using python 2.5) to
> start a process, and kill it after x minutes/seconds and kill all the
> descendants of it.
> Whats the best way of doing this in python? which module is best suited to
> do this? subprocess?

Yes start with the subprocess module:

http://docs.python.org/library/subprocess.html

cheers
James

-- 
-- James Mills
--
-- "Problems are solved by method"

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


Thread

Re: Running and killing a process in python James Mills <prologic@shortcircuit.net.au> - 2011-05-04 12:31 +1000

csiph-web