title: How to make python script to run sudo command
body: <p>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:</p>
  
  <pre><code>sudo -i
  </code></pre>
  
  <p>So, I tried the following code.</p>
  
  <pre><code>import os
  os.system("sudo -i")
  </code></pre>
  
  <p>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.</p>