title: Prompt user for sudo password to run shell command via tkinter GUI and python3
body: <p><strong>Scenario</strong>:
  I have a tkinter window that has a button and an entry box for a password,
  when the button is pressed it will run a command to perform the following</p>
  <pre><code>sudo apt install mc -y
  </code></pre>
  <p>the code runs and works as expected.
  However I do not want the password to be promoted via the terminal.</p>
  <p><strong>Goal</strong>
  I would like the sudo password to be prompted via the tkinter gui</p>
  <p><strong>Question</strong></p>
  <ol>
  <li>Should I use the entry control on the window to collect the password. and pass that to the subprocess. How would you do that? I have not found any clear examples for sudo.</li>
  <li>Should I take  a different approach?</li>
  </ol>
  <p><strong>Code Snippet</strong></p>
  <pre><code>import os
  import subprocess as sp
  from tkinter import *
  from tkinter import ttk
  from ttkthemes import ThemedTk
  
  #Window Setup
  win = ThemedTk(theme ='clam')
  win.geometry('500x400')
  
  #function
  def example():
      sp.call ([&quot;sudo&quot;, &quot;-S&quot;, &quot;apt&quot;, &quot;install&quot;, &quot;mc&quot;, &quot;-y&quot;])
  
  #button    
  btn = ttk.Button(win,text=&quot;Begin Test &quot;,command=example)
  btn.place(x=180, y=320, height= 30, width=150)
  
  #password Textbox
  pwdtxt = ttk.Entry(win, show=&quot;*&quot;)
  pwdtxt.place(x=180, y=350, height= 30, width=150)
  
  win.mainloop()  
  </code></pre>