Path: csiph.com!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.025 X-Spam-Evidence: '*H*': 0.95; '*S*': 0.00; 'subject:Python': 0.05; 'subject:How': 0.09; 'python': 0.09; '(ubuntu': 0.16; 'received:edu.cu': 0.16; 'subject:limit': 0.16; 'subject:usage': 0.16; 'processor': 0.17; 'solution.': 0.18; 'module': 0.19; 'all,': 0.21; 'tools,': 0.23; 'external': 0.24; 'linux': 0.24; 'script': 0.24; 'header:User-Agent:1': 0.26; 'to:addr:python- list': 0.33; 'there': 0.35; 'but': 0.36; 'useful': 0.36; 'possible': 0.37; 'some': 0.38; 'received:10': 0.38; 'to:addr:python.org': 0.39; 'think': 0.40; 'limit': 0.65; 'regards.': 0.66; 'received:200': 0.71; 'saw': 0.75; 'received:10.36': 0.91 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cnic.edu.cu; s=mail; t=1348153887; bh=x8b1B9eRq5wa2ZqmuLigAyTsiPrdn1Ksh67sh51PoKM=; h=Message-ID:Date:From:MIME-Version:To:Subject:Content-Type: Content-Transfer-Encoding; b=Xw5YtuXOgkLqNo+WIOEPt9Yz344Ydy1f8/lY+o8H+VV6QRP7SQHUMCKU9a5+7pa9B AeOXF9ucsjrsyOZ6p8jiT6Vf2jfD+F9FtiXAw86jQbTTWpYWFIudZxo7gWXKNCpZql r2dg1rotfULY16wjUDN8S9mG43GGr2VpHBoPgE4I= X-Virus-Scanned: Debian amavisd-new at mx2.cnic.edu.cu DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cnic.edu.cu; s=mail; t=1348153886; bh=x8b1B9eRq5wa2ZqmuLigAyTsiPrdn1Ksh67sh51PoKM=; h=Message-ID:Date:From:MIME-Version:To:Subject:Content-Type: Content-Transfer-Encoding; b=g8PY7z2Nlfx6BRADvsCA8oM/AF2kAPjcBXt6IQUsXT0z9UCurEPFV7gURrHpLZaXI TVv5xTstYV6/SCT2knCeEd7hc++mjyTSHWuIZiXc98aI7TQRUZQ/X89pgmdPdi9jfW dnvlSx176Q0q2qv1lVRa0xYR+UgElNRLAd4YCf4w= Date: Thu, 20 Sep 2012 11:12:44 -0400 From: =?ISO-8859-1?Q?Rolando_Ca=F1er_Roblejo?= User-Agent: Mozilla/5.0 (X11; Linux i686; rv:14.0) Gecko/20120714 Thunderbird/14.0 MIME-Version: 1.0 To: python-list@python.org Subject: How to limit CPU usage in Python Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 10 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1348154419 news.xs4all.nl 6923 [2001:888:2000:d::a6]:47731 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:29554 Hi all, Is it possible for me to put a limit in the amount of processor usage (% CPU) that my current python script is using? Is there any module useful for this task? I saw Resource module but I think it is not the module I am looking for. Some people recommend to use nice and cpulimit unix tools, but those are external to python and I prefer a python solution. I am working with Linux (Ubuntu 10.04). Best regards.