title: Python: Get Mount Point on Windows or Linux
body: <p>I need a function to determine if a directory is a mount point for a drive.
  I found this code already which works well for linux:</p>
  
  <pre><code>def getmount(path):
    path = os.path.abspath(path)
    while path != os.path.sep:
      if os.path.ismount(path):
        return path
      path = os.path.abspath(os.path.join(path, os.pardir))
    return path
  </code></pre>
  
  <p>But I'm not sure how I would get this to work on windows. Can I just assume the mount point is the drive letter (e.g. C:)? I believe it is possible to have a network mount on windows so I'd like to be able to detect that mount as well.</p>