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?"


_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to