how to spawn a process under different user

Tim Golden mail at
Thu Jul 2 22:58:03 CEST 2009

sanket wrote:
> Hello All,
> I am trying to use python's subprocess module to launch a process.
> but in order to do that I have to change the user.
> I am not getting any clue how to do that?
> so can anyone please tell me How can I spawn a process under different
> user than currently I am logging in as.

What platform are you on? If you are on Windows,
there was a thread on this subject some time in
the last month. (Short answer: switching user before
launching subprocess won't work; switching within
the subprocess will...)


More information about the Python-list mailing list