will return the most recent threads in your gmail account you can pass an optional maxresults keyword argument to change this limitrecentthreads ezgmail recent(len(recentthreads recentthreads ezgmail recent(maxresults= len(recentthreads searching mail from gmail account in addition to using ezgmail unread(and ezgmail recent()you can search for specific emailsthe same way you would if you entered queries into the resultthreads ezgmail search('robocop'len(resultthreads ezgmail summary(resultthreadsaljon do you want to watch robocop this weekenddec the previous search(call should yield the same results as if you had entered "robocopinto the search boxas in figure - figure - searching for "robocopemails at the gmail website like unread(and recent()the search(function returns list of gmailthread objects you can also pass any of the special search operators that you can enter into the search box to the search(functionsuch as the followingfor unread emails 'from:al@inventwithpython comfor emails from al@inventwithpython com 'subject:hellofor emails with "helloin the subject 'has:attachmentfor emails with file attachments 'label:unreadyou can view full list of search operators at /mail/answer/ ?hl=endownloading attachments from gmail account the gmailmessage objects have an attachments attribute that is list of filenames for the message' attached files you can pass any of these names to sending email and text messages