How to check mail from Amazon WorkMail in Python

Finally, Amazon added IMAP support to WorkMail, so now it’s pretty easy to get mail from it. Next is pretty simple piece of code how to get mail in Python3 from Amazon WorkMail: Python import sys import imaplib import email import email.header import datetime // find imap host for your region here: http://docs.aws.amazon.com/general/latest/gr/rande.html#wm_region M = imaplib.IMAP4_SSL('imap.mail.eu-west-1.awsapps.com') M.login('email@example.com', 'password') M.select("inbox") rv, data = M.search(None, "ALL") if rv != 'OK': print("No messages found!") else: for num in data[0].split(): rv, data = M.fetch(num, '(RFC822)') if rv != 'OK': print("ERROR getting message", num) continue msg = email.message_from_bytes(data[0][1]) hdr = email.header.make_header(email.header.decode_header(msg['Subject'])) subject = str(hdr) print('Message %s: %s' % (num, subject)) print('Date:', msg['Date']) 1234567891011121314151617181920212223242526272829 import sysimport imaplibimport emailimport email.headerimport datetime // find imap host for your region here: http://docs.aws.amazon.com/general/latest/gr/rande.html#wm_regionM = imaplib.IMAP4_SSL('imap.mail.eu-west-1.awsapps.com')M.login('email@example.com', 'password') M.select("inbox") rv, data = M.search(None, "ALL") if rv != 'OK':print("No messages found!")else:for num in data[0].split():rv, data = M.fetch(num, '(RFC822)')if rv != 'OK':print("ERROR getting message", num)continue msg = email.message_from_bytes(data[0][1])hdr = email.header.make_header(email.header.decode_header(msg['Subject']))subject = str(hdr) print('Message %s: %s' % (num, subject))print('Date:', msg['Date']) Here is pretty good imaplib...

Great video to start with Shiny apps

In this intro to making interactive apps with R, RStudio programming maven Joe Cheng introduces you (and the Los Angeles R Users Group) a revealing overview of how quick and easy it is to make and publish Shiny...

Hello world!

Hello, this my first post. I want to write a few strings about “Hello world” programs. Right now I’m passioned about R programming language. Code for Hello world program in R looks pretty trivial, for example: R cat('Hello, world!\n') 1 cat('Hello, world!\n') In Java language programs are a little more difficult, but still boring: Java public class HelloWorld { public static void main(String[] args) { System.out.println("Hello, world!"); } } 12345 public class HelloWorld {    public static void main(String[] args) {        System.out.println("Hello, world!");    }} Let’s go to esoteric programming languages (esolang). An esolang is a programming language designed for fun or just to test the boundaries of computer programming languages. Classic esolang is Brainfuck, Hello World program looks pretty interesting: +++++ +++++ initialize counter (cell #0) to 10 [ use loop to set the next four cells to 70/100/30/10/40 > +++++ ++ add 7 to cell #1 > +++++ +++++ add 10 to cell #2 > +++ add 3 to cell #3 > + add 1 to cell #4 > ++++ add 4 to cell #5 <<<<< - decrement counter (cell #0) ] > ++ . print 'H' > + . print 'e' +++++ ++ . print 'l' . print 'l' +++ . print 'o' >>> ++++ . print ',' << ++ . print ' ' < +++++ +++ . print 'w' ----- --- . print 'o' +++ . print 'r' ----- - . print 'l' ----- --- . print 'd' > + . print '!' > . print '\n' 123456789101112131415161718192021222324 +++++ +++++ initialize counter (cell #0) to 10[ use loop to set the next four cells to 70/100/30/10/40> +++++ ++ add 7 to cell #1>...