use sudo command in python

August 27, 2011 at 03:23:22
Specs: linux
I am new to python ,Currently i m developing one small script in python and os-linux.
I need to mound to window from linux-python 2.6. I able to mount to window xp using "sudo mount " command. But I don't want paswword prompt to enter password it should be given through python as variable.
Please help me as soon as possible.
Thanks in advance

See More: use sudo command in python

Report •


#1
August 28, 2011 at 20:18:30
I am barely beyond "hello world" in python myself, but I don't think you are going to be able to use sudo directly with python.

The sudo command, like passwd, is an interactive program which means you can not redirect input - such as the password - to it. The Expect programming language is designed to deal with Unix/Linux interactive programs. Check out these two links for more information:

http://www.computing.net/answers/un...
http://www.computing.net/answers/un...


Report •
Related Solutions


Ask Question