ubuntu-tour team mailing list archive
-
ubuntu-tour team
-
Mailing list archive
-
Message #00002
Re: Determining running processes
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 <alex@xxxxxxxxxxxxx> 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 : ubuntu-tour@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~ubuntu-tour
> More help : https://help.launchpad.net/ListHelp
>
Follow ups
References