Python & Linux, some questions

bobb rawbobb at hotmail.com
Sun Mar 14 19:14:58 EST 2004


I use pexpect to telnet and ssh...

"Luca T." <lucat at despammed.com> wrote in message
news:c32b2j$222k3a$1 at ID-99001.news.uni-berlin.de...
> Hello,
> i need some answers...
>
> 1) I need to run some linux commands (from inside my app) that require
> superuser privileges (mkfs, losetup, etc), how do i do that? (I do not
> want to run my app with root privileges, but it will just ask the user
> for the root password before proceeding)
> 2) When i execute the command i need to read its output (especially the
> error messages) to know if everything went fine but i do not know how :(
> 3) How can i know if the user that is running my app is root or normal
user?
>
> Thank you,
>     Luca





More information about the Python-list mailing list