Created
November 1, 2011 13:53
-
-
Save esehara/1330542 to your computer and use it in GitHub Desktop.
Gmail -> Eject CD
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import imaplib | |
import pygame | |
def cd_eject(): | |
pygame.cdrom.init() | |
cd = pygame.cdrom.CD(0) | |
cd.init() | |
cd.eject() | |
def mail_check(user,passw): | |
mail = imaplib.IMAP4_SSL("imap.gmail.com") | |
mail.login(user,passw) | |
mail.select("Inbox") | |
status,maillist = mail.search(None,"(UNSEEN)") | |
if status == "OK": | |
if maillist[0] is not '': cd_eject() | |
mail.logout() | |
if __name__ == "__main__": | |
mail_check("FIXME : hoge@gmail.com","FIXME : PASS") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment