Tino Dai wrote: > Hi there, > > I'm have a tough time figuring out how to get su and subprocess > working. I have > > PIPE=subprocess.pipe > > sbp=subprocess.Popen(["su","-",stdin=PIPE,stdout=PIPE,close_fds=True,shell=True) > > > > how I thought that it was supposed to work was it would allow me to > use sbp.communicate() to > send stuff to the stdin, and get information out. What do get is a > prompt ask for my password.
I think you have the right understanding of Popen, you seem to be missing out on "su". What happens when you type "su -" on the command line? > Does > anybody have an example that I can see (I have already check most of > the entries in google( or should > I just use pexpect instead? > > -Thanks, > Tino > > ------------------------------------------------------------------------ > > _______________________________________________ > Tutor maillist - Tutor@python.org > http://mail.python.org/mailman/listinfo/tutor > _______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor