title: How to run python process as another Windows user
body: <p>With the <code>subprocess.Popen</code> we can call any executable under the currently logged-in user credentials like so:</p>
  
  <pre><code>import subprocess 
  cmd = ['C:\Windows\system32\executable.exe']
  proc = subprocess.Popen(cmd, cwd=os.path.dirname(RAR_EXE), stdout=subprocess.PIPE)
  output = proc.stdout.read()
  </code></pre>
  
  <p>Would it be possible to call and execute the same <code>executable.exe</code> under another user credentials assuming that the user's name and the password are known, such as:</p>
  
  <pre><code>username = 'steve'
  password = 'password123`
  </code></pre>