Brian Allen Vanderburg II
BrianVanderburg2 at aim.com
Fri Jan 30 05:58:41 CET 2009
linuxguy123 at gmail.com wrote:
> Does anyone know where I would find libsudo ?
> If you had the choice of using pexpect or libsudo, which would you use ?
libsudo does all the work for you of executing sudo, checking for the
expected responses and all. If all you need it for is to use sudo from
Python I suspect it would be easier than pexpect.
It is a C library however, so after being compiled and installed, you
will need to use ctypes to use it. It is very simple, as the only
function to deal with is:
int runAs( char* command, char* password, char* user, int invalidate );
Brian Vanderburg II
More information about the Python-list