title: wmi diskdrive size excluding external devices
body: <p>I'm trying to show the size of the main hard drive excluding the size of any external devices as well as usb flash drives</p>
  <p>This is the query I'm using</p>
  <pre><code>def get_hdd():
      size = 0
      con = wmi.WMI()
      for element in con.query('SELECT Size FROM Win32_DiskDrive'):
          size += int(element.Size)
      return str(math.floor(size / 1073741824)) + ' ' + 'Go'
  </code></pre>
  <p>How can I exclude any external devices from the query ? This is the output of the query with all the columns, and I was wondering if any of them can be used to exclude external devices</p>
  <p><a href="https://i.stack.imgur.com/5YULk.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/5YULk.png" alt="enter image description here" /></a></p>
  <p>I was thinking of using <code>MediaType</code> which says <code>'Fixed hard disk media'</code>, but I'm not sure if it's the same regardless of Windows language</p>