title: Is there a clean way to check if a given user exists on a computer through python?
body: <p>Currently I am using pwd.getpwall(), which shows me the entire password database. But I just want the users accounts of the computer. And with using getpwall() I am unable to do this ...</p>
  
  <pre><code>if 'foo' in pwd.getpwall():
       do stuff
  </code></pre>
  
  <p>since pwd.getpwall() returns a list of objects. And if I wanted to check if a user exist I would have to do a loop. I assume there is an easier way to do this.</p>