Sure,

you can do something like this too (in python)

import commands
output = commands.getoutput('ps -A')
if 'firefox' in output:
    print "Firefox is running!!"


Cheers
-
Brandon Jardine



On Fri, Aug 20, 2010 at 00:19, Alexander Lancey <[email protected]> wrote:

> This seems to be a shorter method of doing the same task:
>
> ps -C firefox
>
> This is probably more efficient, but it takes all the strings literally.
> For example, ps -C chromium doesn't see Chrome, because it is running
> with an argument or something.
>
>
> _______________________________________________
> Mailing list: https://launchpad.net/~ubuntu-tour
> Post to     : [email protected]
> Unsubscribe : https://launchpad.net/~ubuntu-tour
> More help   : https://help.launchpad.net/ListHelp
>
_______________________________________________
Mailing list: https://launchpad.net/~ubuntu-tour
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~ubuntu-tour
More help   : https://help.launchpad.net/ListHelp

Reply via email to