title: IMAP with python to download attachments
body: <p>I have a instrument at work that emails me a file containing raw data, I can go into my email and download them easily enough but when I have multiple files (which it sends as multiple emails) it gets a bit tedious. </p>
  
  <p>I'm looking at using <code>python</code> and <code>imaplib</code> to login to my email account, search for emails from a known email address within the past day or so and then download any attachments to a directory. So I thought a script  might help here. </p>
  
  <p>I've setup a gmail account and altered the settings so that I can connect using imap from a shell, however I'm lost as to where to go from here. </p>
  
  <p>Could someone point me in the right direction as to what I need to do to make this happen. </p>