(('\\hasnochildren',)'/''inbox')(('\\hasnochildren',)'/''sent')--snip-(('\\hasnochildren''\\flagged')'/''starred')(('\\hasnochildren''\\trash')'/''trash')the three values in each of the tuples--for example(('\hasnochildren',)'/''inbox')--are as followsa tuple of the folder' flags (exactly what these flags represent is beyond the scope of this bookand you can safely ignore this field the delimiter used in the name string to separate parent folders and subfolders the full name of the folder to select folder to search throughpass the folder' name as string into the imapclient object' select_folder(method imapobj select_folder('inbox'readonly=trueyou can ignore select_folder()' return value if the selected folder does not existpython raises an imaplib error exception the readonly=true keyword argument prevents you from accidentally making changes or deletions to any of the emails in this folder during the subsequent method calls unless you want to delete emailsit' good idea to always set readonly to true performing the search with folder selectedyou can now search for emails with the imapclient object' search(method the argument to search(is list of stringseach formatted to the imap' search keys table - describes the various search keys note that some imap servers may have slightly different implementations for how they handle their flags and search keys it may require some experimentation in the interactive shell to see exactly how they behave you can pass multiple imap search key strings in the list argument to the search(method the messages returned are the ones that match all the search keys if you want to match any of the search keysuse the or search key for the not and or search keysone and two complete search keys follow the not and orrespectively sending email and text messages