You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
classGmail:
def__init__(self, username, password):
self.username=usernameself.password=passworddef__enter__(self):
# note: getpass might be better here, instead of keeping the pwd in memoryself.g=gmail.login(self.username, self.password)
returnself.gdef__exit__(self, *args, **kwds):
try:
print('logging out...')
self.g.logout()
except:
raise
allows this
withGmail(username, password) asconn:
print('Reading all your emails from spam folder:')
spam_box=conn.spam().mail(prefetch=True)
n=conn.spam().count()
foridx, emailinenumerate(spam_box):
print('fetching %d of %d...'% (idx+1, n))
which would be nice to have implemented in the gmail package
The text was updated successfully, but these errors were encountered:
Something like this
allows this
which would be nice to have implemented in the
gmail
packageThe text was updated successfully, but these errors were encountered: