[Tutor] Help with daemon

Max Noel maxnoel_fr at yahoo.fr
Fri Apr 29 02:05:12 CEST 2005

On Apr 28, 2005, at 23:06, Alberto Troiano wrote:

> I tried:
>>>> import os
>>>> os.system("ps --user root")
> and I get
> 0
> as a return
> How can I get the PID and bind the command above with a variable?? I 
> mean
> varusername="root"
> os.system("ps --user varusername")
> works???????

	So in essence, what you're trying to do is store the output of a 
command in a variable, right?
	You might be interested in the os.popen family of functions.

-- Max
maxnoel_fr at yahoo dot fr -- ICQ #85274019
"Look at you hacker... A pathetic creature of meat and bone, panting 
and sweating as you run through my corridors... How can you challenge a 
perfect, immortal machine?"

More information about the Tutor mailing list