title: Python: How to get domain\username for logged in user
body: <p>In Python how do I get the logged in username in the domain\username format.  The following just get username:</p>
  
  <pre class="lang-py prettyprint-override"><code>import getpass
  import os
  
  print(os.getlogin())
  print(getpass.getuser())
  </code></pre>