I have to execute few commands in linux but I need to be a super user before I execute the command. This has to be done via python script The scenario is i should execute the following command in the order
>> su
This prompts for password
After entering the password I will have to execute the bluez commands
>> hciconfig hci0 up
>> hcitool lescan
>> hcitool lecc <address>
i need to do this in python but could you please tell me how to be a super user and give password via python then later execute the above commands in order? Meaning,I want to automate the whole process that is execute all the commands without manual intervention.