title: give a root privilege to a python GUI application to run a command in ubuntu
body: <p>Now, i have a python GUI app which need to run a command with sudo privilege like this below:</p>
  <pre><code>import commands
  iStat, askpassPath = commands.getstatusoutput(&quot;which ssh-askpass&quot;)
  cmd = &quot;export SUDO_ASKPASS=%s;sudo -A mkdir -p /usr/lib/test&quot;%(askpassPath)
  commands.getstatusoutput(cmd)
  </code></pre>
  <p><a href="https://i.stack.imgur.com/rF4ng.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/rF4ng.png" alt="enter image description here" /></a></p>
  <p>This works fine if ssh-askpass has been installed on ubuntu.But it seems some ubuntu systems don't install it by default while i can't install it for them.</p>
  <p>So, I need to know if there is another way for me to get a sudo privilege.</p>
  <p>Thanks in advance.</p>
  <p>Edit:The app should not be started with root privilege.It needs to get root privilege only when it is running.</p>