executing su under Python
lumbricus at gmx.net
Tue Sep 25 23:12:46 CEST 2001
Brett Cannon <bac at ocf.berkeley.edu> wrote:
> 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"
You may have a look at sudo.
> 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.
Q: How do you save a drowning lawyer?
A: Throw him a rock.
More information about the Python-list