Assuming:
>>> d=dict([('10:04:14', 1), ('3', 6), ('Thu', 6), ('19:51:21', 1),
... ('2008',27), ('From', 27), ('11:35:08', 1), ('5', 1),
... ('sntp@hotmail.com', 3), ('Jan', 27), ('15:46:24', 1), ('14:50:18',
... 1), ('11:37:30', 1), ('18:10:48', 1), ('17:07:00', 1), ('09:05:31',
... 1), ('10:38:42', 1), ('sdusa@yahoo.com', 1),
... ('samuel.david@gmail.com', 4) ])
If the address are of the type you show, you can use filter
on the keys:
>>> list(filter(lambda s: '@' in s, d.keys()))
['sdusa@yahoo.com', 'samuel.david@gmail.com', 'sntp@hotmail.com']
If, however, you might have more complete strings representing the RFC822 email address of 'Comment' <address>
type (or a mixture) you might want to use email.utils.parseaddr() to separate the comment (or real name) from the actual address:
>>> from email.utils import parseaddr
>>> parseaddr('"Santa" <Santa@np.org>')
('Santa', 'Santa@np.org')
So then:
>>> d=dict([('10:04:14', 1), ('3', 6), ('Thu', 6), ('19:51:21', 1),
... ('2008',27), ('From', 27), ('11:35:08', 1), ('5', 1),
... ('sntp@hotmail.com', 3), ('Jan', 27), ('15:46:24', 1), ('14:50:18',
... 1), ('11:37:30', 1), ('18:10:48', 1), ('17:07:00', 1), ('09:05:31',
... 1), ('10:38:42', 1), ('sdusa@yahoo.com', 1),
... ('"Sammy Davis, Jr." <samuel.david@gmail.com>', 4) ])
>>>
>>> from email.utils import parseaddr
>>> [parseaddr(s)[1] for s in d.keys() if '@' in parseaddr(s)[1]]
['sntp@hotmail.com', 'samuel.david@gmail.com', 'sdusa@yahoo.com']
Note: parseaddr
Only separates the parts of a valid but complete RFC822 address; it does not validate that it is a real address.