title: Run a linux system command as a superuser, using a python script
body: <p>I have got postfix installed on my machine and I am updating virtual_alias on the fly programmatically(using python)(on some action). Once I update the entry in the /etc/postfix/virtual_alias, I am running the command:<pre><code>sudo /usr/sbin/postmap /etc/postfix/virtual_alias 2>>/work/postfix_valias_errorfile</code></pre>But I am getting the error:<pre><code>sudo: sorry, you must have a tty to run sudo</code></pre></p>
  
  <p>I want to run the mentioned sudo command in a non-human way(meaning, I am running this system command from a python script.). So how do I get this command run programmatically?</p>