title: Reading Gmail Email in Python
body: <p>I am attempting to create a simple script to check my Gmail for emails with a certain title. When I run this program on Python 3.7.3 I receive this data: <code>('OK', [b'17'])</code>.</p>
  
  <p>I need to access the body of the email within python. I am just not sure what to do with the data that I have.</p>
  
  <p>Here is my current code:</p>
  
  <pre><code>import imaplib
  import credentials
  
  imap_ssl_host = 'imap.gmail.com'
  imap_ssl_port = 993
  username = credentials.email
  password = credentials.passwd
  server = imaplib.IMAP4_SSL(imap_ssl_host, imap_ssl_port)
  
  server.login(username, password)
  server.select('INBOX')
  
  data = server.uid('search',None, '(SUBJECT "MY QUERY HERE!")')
  print(data)
  </code></pre>
  
  <p>The result from running the code:</p>
  
  <pre class="lang-none prettyprint-override"><code>('OK', [b'17'])
  </code></pre>
  
  <p>I know it is a little rough, but I am still learning, so any advice you have to help me improve would be greatly appreciated!</p>