<Sean DiZazzo – Donnerstag, 28. Mai 2009 10:11>
> Your best bet is to make sudo not ask for a password. :) If you
> don't have the rights, then you can use pexpect to do what you want to
> do. http://pexpect.sourceforge.net/pexpect.html
>
> See the second example on that page.
>
> child = pexpect.spawn('scp foo [email protected]:.')
> child.expect ('Password:')
> child.sendline (mypassword)
The sudo password prompt is very configurable, so changing the configuration
to allow execution without password input is really the best option.
--
Freedom is always the freedom of dissenters.
(Rosa Luxemburg)
--
http://mail.python.org/mailman/listinfo/python-list