Aw: Re: Extract lines from file, add to new files

Mats Wichmann mats at wichmann.us
Tue Jan 30 17:18:20 EST 2024


On 1/30/24 14:46, AVI GROSS via Python-list wrote:
> Rich,
> 
> You may want to broaden your perspective a bit when people make suggestions.
> 
> Karsten did not spell out a full design and should not need to.
> 
> But consider this as a scenario.
> 
> You want to send (almost) the same message to one or more recipients.
> 
> So call a program, perhaps some variant on a shell script, that does some
> prep work such as maybe creating a temporary or working directory/folder.
> Had one copy of your message ready in a file somewhere, Have a way to get a
> list of recipients intended and the file or files containing enough info to
> link email addresses to human names and anything else such as their
> preferred pronoun  or address.

I'd say based on the bits of the problem description I *have* absorbed, 
which almost certainly isn't all of them, there's a fairly basic 
capability, not terribly often used in my experience, that might be of 
some use:

https://docs.python.org/3/library/string.html#template-strings




More information about the Python-list mailing list