Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Python: Python

Re: Python implmenentation of finding process's command line parameters.

 

 

Python python RSS feed   Index | Next | Previous | View Threaded


gnewsg at gmail

Jul 3, 2009, 12:33 PM

Post #1 of 6 (216 views)
Permalink
Re: Python implmenentation of finding process's command line parameters.

On 3 Lug, 21:15, Tim Golden <m...@timgolden.me.uk> wrote:
> dudeja.ra...@gmail.com wrote:
> > I'm looking for some python implementation of finding the command line
> > parameters of a process on Windows XP SP3 machine. I found some links but
> > they all point me to the direction of c/c++ implememtations.
>
> > I've seen WMI, but this takes time to load. So I just though if some one has
> > done implementation and could pointing me in some right direction.
>
> Someone recently posted an example using PSI [1] which seemed
> quite fast.
>
> TJG
>
> [1]http://www.psychofx.com/psi/trac/wiki/

If I'm not mistaken psi shouldn't support Windows.
You can use psutil:
http://code.google.com/p/psutil/

>>> import psutil
>>> p = psutil.Process(7055)
>>> p.cmdline
['/usr/bin/python', '-O']
>>>

--- Giampaolo
http://code.google.com/p/pyftpdlib
http://code.google.com/p/psutil/
--
http://mail.python.org/mailman/listinfo/python-list


dudeja.rajat at gmail

Jul 3, 2009, 12:41 PM

Post #2 of 6 (204 views)
Permalink
Re: Python implmenentation of finding process's command line parameters. [In reply to]

I have had a look at psutil, however, this only works with Python 2.6.x and
above. We are using Python 2.5.2 and updating python could pose certain
problems. So, I'm not keep on using psutils.

--
Regrads,
Rajat


mail at timgolden

Jul 3, 2009, 12:48 PM

Post #3 of 6 (204 views)
Permalink
Re: Python implmenentation of finding process's command line parameters. [In reply to]

Giampaolo Rodola' wrote:
> On 3 Lug, 21:15, Tim Golden <m...@timgolden.me.uk> wrote:
>> dudeja.ra...@gmail.com wrote:
>>> I'm looking for some python implementation of finding the command line
>>> parameters of a process on Windows XP SP3 machine. I found some links but
>>> they all point me to the direction of c/c++ implememtations.
>>> I've seen WMI, but this takes time to load. So I just though if some one has
>>> done implementation and could pointing me in some right direction.
>> Someone recently posted an example using PSI [1] which seemed
>> quite fast.
>>
>> TJG
>>
>> [1]http://www.psychofx.com/psi/trac/wiki/
>
> If I'm not mistaken psi shouldn't support Windows.
> You can use psutil:
> http://code.google.com/p/psutil/

Sorry. Exactly what I meant. (Should have checked for
the exact post rather than trusting to my memory).

TKG
--
http://mail.python.org/mailman/listinfo/python-list


mail at timgolden

Jul 3, 2009, 12:48 PM

Post #4 of 6 (204 views)
Permalink
Re: Python implmenentation of finding process's command line parameters. [In reply to]

Giampaolo Rodola' wrote:
> On 3 Lug, 21:15, Tim Golden <m...@timgolden.me.uk> wrote:
>> dudeja.ra...@gmail.com wrote:
>>> I'm looking for some python implementation of finding the command line
>>> parameters of a process on Windows XP SP3 machine. I found some links but
>>> they all point me to the direction of c/c++ implememtations.
>>> I've seen WMI, but this takes time to load. So I just though if some one has
>>> done implementation and could pointing me in some right direction.
>> Someone recently posted an example using PSI [1] which seemed
>> quite fast.
>>
>> TJG
>>
>> [1]http://www.psychofx.com/psi/trac/wiki/
>
> If I'm not mistaken psi shouldn't support Windows.
> You can use psutil:
> http://code.google.com/p/psutil/

Sorry. Exactly what I meant. (Should have checked for
the exact post rather than trusting to my memory).

TJG
--
http://mail.python.org/mailman/listinfo/python-list


tjgolden at gmail

Jul 3, 2009, 12:50 PM

Post #5 of 6 (204 views)
Permalink
Re: Python implmenentation of finding process's command line parameters. [In reply to]

dudeja.rajat[at]gmail.com wrote:
> I have had a look at psutil, however, this only works with Python 2.6.x and
> above. We are using Python 2.5.2 and updating python could pose certain
> problems. So, I'm not keep on using psutils.

Doesn't look as if there's anything 2.6-specific there.
Maybe the maintainer can comment, but I suspect you'd
just need to recompile and link against 2.5

TJG
--
http://mail.python.org/mailman/listinfo/python-list


gnewsg at gmail

Jul 3, 2009, 12:57 PM

Post #6 of 6 (205 views)
Permalink
Re: Python implmenentation of finding process's command line parameters. [In reply to]

On 3 Lug, 21:50, Tim Golden <tjgol...@gmail.com> wrote:

> Sorry. Exactly what I meant. (Should have checked for
> the exact post rather than trusting to my memory)

No prolem.

> dudeja.ra...@gmail.com wrote:
> > I have had a look at psutil, however, this only works with Python 2.6.x and
> > above. We are using Python 2.5.2 and updating python could pose certain
> > problems. So, I'm not keep on using psutils.
>
> Doesn't look as if there's anything 2.6-specific there.
> Maybe the maintainer can comment, but I suspect you'd
> just need to recompile and link against 2.5
>
> TJG

psutil works on Python 2.4, 2.5 and 2.6.
If you are on Windows, you can get the precompiled binary for Python
2.5 from here:
http://code.google.com/p/psutil/downloads/list


--- Giampaolo
http://code.google.com/p/pyftpdlib
http://code.google.com/p/psutil/
--
http://mail.python.org/mailman/listinfo/python-list

Python python RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact lists@gossamer-threads.com
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.