Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Re: How to get memory and CPU status of a particular process

Reply
Thread Tools

Re: How to get memory and CPU status of a particular process

 
 
Chris Rebert
Guest
Posts: n/a
 
      02-23-2010
> On Tue, Feb 23, 2010 at 9:18 AM, R. P. Janaka <> wrote:
>> Hi all,
>>
>> Is there a way to get system memory consumption and CPU consumption in a
>> platform independent way, using python...?
>>
>> Basically my requirement is, get the memory status and CPU status of a
>> particular process. If there is a way to get memory info and CPU info by
>> just giving the process ID, that is exactly what I need to do
>> Is this possible with python..?


Given Turing-completeness, one should more precisely ask whether there
is already a library for doing something in Python rather than whether
something is possible with Python.

On Mon, Feb 22, 2010 at 10:12 PM, R. P. Janaka <> wrote:
> Please can anyone help me..??


It is generally customary to wait /at least/ one day before pinging on
one's question again.

If you were to have searched PyPI (http://pypi.python.org), you would
have found psutil, which seems to fit your bill:
http://code.google.com/p/psutil/

Cheers,
Chris
--
This completes today's Netiquette lesson.
http://blog.rebertia.com
 
Reply With Quote
 
 
 
 
Paul Rudin
Guest
Posts: n/a
 
      02-23-2010
Chris Rebert <> writes:

>> On Tue, Feb 23, 2010 at 9:18 AM, R. P. Janaka <> wrote:
>>> Hi all,
>>>
>>> Is there a way to get system memory consumption and CPU consumption in a
>>> platform independent way, using python...?
>>>
>>> Basically my requirement is, get the memory status and CPU status of a
>>> particular process. If there is a way to get memory info and CPU info by
>>> just giving the process ID, that is exactly what I need to do
>>> Is this possible with python..?

>
> Given Turing-completeness, one should more precisely ask whether there
> is already a library for doing something in Python rather than whether
> something is possible with Python.


Turing-completeness is irrelevant to questions like getting memory and
CPU info for a process. These are not issues of computability...
 
Reply With Quote
 
 
 
 
Chris Rebert
Guest
Posts: n/a
 
      02-23-2010
On Mon, Feb 22, 2010 at 11:16 PM, Paul Rudin <> wrote:
> Chris Rebert <> writes:
>>> On Tue, Feb 23, 2010 at 9:18 AM, R. P. Janaka <> wrote:
>>>> Is there a way to get system memory consumption and CPU consumption in a
>>>> platform independent way, using python...?
>>>>
>>>> Basically my requirement is, get the memory status and CPU status of a
>>>> particular process. If there is a way to get memory info and CPU info by
>>>> just giving the process ID, that is exactly what I need to do
>>>> Is this possible with python..?

>>
>> Given Turing-completeness, one should more precisely ask whether there
>> is already a library for doing something in Python rather than whether
>> something is possible with Python.

>
> Turing-completeness is irrelevant to questions like getting memory and
> CPU info for a process. These are not issues of computability...


True, but given that it is possible to access most *nix APIs from
Python and win32all provides what I understand to be extensive access
to the Win32 API from Python, cross-platform coding is almost always
possible in Python. You might have to manually deal with each case
yourself though. (More technically, I suppose that's being
multi-platform with relatively easy DIY cross-platform).

Cheers,
Chris
--
http://blog.rebertia.com
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
Very high CPU load with FF on particular site DavidM Firefox 11 11-27-2006 03:57 PM
How to get the status of the runtime process in java..? janak Java 1 08-09-2006 11:29 AM
memory/cpu usage by process in win2000/XP Luki Perl Misc 1 12-10-2005 04:51 PM
Get the status of a process Gilles Lenfant Python 2 11-28-2003 01:44 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57