a subprocess qns

micklee74 at hotmail.com micklee74 at hotmail.com
Thu Apr 20 22:29:57 EDT 2006


hi
i wanted to start execute a command and put it in the background. i am
using Unix.
Usually i start this command using something like this :
"/path/somecmd  &" with the "&" to put it to background.
i looked at the subprocess module docs and came across this statement
Replacing os.spawn*
-------------------
P_NOWAIT example:
pid = os.spawnlp(os.P_NOWAIT, "/bin/mycmd", "mycmd", "myarg")
==>
pid = Popen(["/bin/mycmd", "myarg"]).pid


Can i ask if P_NOWAIT means the same as "&" ?? so if it is, then  this
statement
pid = os.spawnlp(os.P_NOWAIT, "/bin/mycmd", "mycmd", "myarg")

will put mycmd into background and return to the caller...?

thanks




More information about the Python-list mailing list