Sorry, I am new to python and I need to make a python script, to run some terminal commands. Normal commands are ok. But, the problem is with sudo commands. For example: I need to run:
sudo -i
So, I tried the following code.
import os
os.system("sudo -i")
This code is executing the command, but in terminal, it is asking for password. So, is it possible to add the password with the command in the script, so that, it won't ask for passwords? For example: if my password is "MYPASS12", how can I add it in the code, so it won't make problem.