executing su under Python

Brett Cannon bac at OCF.Berkeley.EDU
Tue Sep 25 16:19:56 EDT 2001


I have been following the recent posts about executing terminal commands
on the newsgroup recently in hopes of solving my problem.  Unfortunately,
nothing seems to have worked so far.  I am hoping someone has a solution.

I am trying to execute this line under Solaris 8:
su bac -c "lp /tmp/bac.print"

The trouble I keep running into is when I try to pass in my password.  No
matter how I try to handle it, either the pipes freeze up under popen*, or
I get a broken fd message (from the child_process.py file uploaded to
c.l.p a few days ago), something goes wrong.  I have yet to ever get any
command that requires a password to the terminal to work under Python.

Any help is appreciated.  Thanks.

-Brett C.




More information about the Python-list mailing list