FW: Re: e-mailing multiple values

axjacob at comcast.net axjacob at comcast.net
Tue May 8 19:52:47 EDT 2007


Thanks. 
That does help. When teh script sends a mail of the list item(all_data), the data shows up like this:

[('   Ham                \n', '   eggs                         \n'), 
('   chicken              \n', '   thighs                     \n')]

So I have to figure out a way to cleanup the content

Thanks
Anil
 
> -------------- Forwarded Message: --------------
> From: "Ian Clark" <turbana at gmail.com>
> To: python-list at python.org
> Subject: Re: e-mailing multiple values
> Date: Tue, 8 May 2007 23:20:44 +0000
> > On 5/8/07, anil_jacob at comcast.net <anil_jacob at comcast.net> wrote:
> > >
> > > I have a script which has a method which returns multiple strings at once 
> > using the yield. I would like to send an e-mail of these values in a single 
> > e-mail instead of a mail for each string. How would I be able to do that?
> > >
> > > Thanks
> > > AJ
> > 
> > Are you looking for something like the following? If not, try posting
> > a small sampling of your code.
> > 
> > >>> def get_data():
> > ...     data = ['ham', 'eggs', 'spam']
> > ...     for item in data:
> > ...             yield item
> > ...
> > >>> all_data = [item for item in get_data()]
> > >>> all_data
> > ['ham', 'eggs', 'spam']
> > 
> > Ian
> > -- 
> > http://mail.python.org/mailman/listinfo/python-list
> 




More information about the Python-list mailing list