It's been several years since I've needed to write a python script so I'm
asking for advice to get me started with a brief script to separate names
and email addresses in one file into two separate files: salutation.txt and
emails.txt.
An example of the input file:
Calvin
cal...@example.com
Hob
On 2024-01-11 18:08, Rich Shepard via Python-list wrote:
It's been several years since I've needed to write a python script so I'm
asking for advice to get me started with a brief script to separate names
and email addresses in one file into two separate files: salutation.txt and
emails.txt.
An
On Thu, 11 Jan 2024, MRAB via Python-list wrote:
From the look of it:
1. If the line is empty, ignore it.
2. If the line contains "@", it's an email address.
3. Otherwise, it's a name.
MRAB,
Thanks. I'll take it from here.
Regards,
Rich
--
https://mail.python.org/mailman/listinfo/python-lis
On 1/11/24 11:27, MRAB via Python-list wrote:
On 2024-01-11 18:08, Rich Shepard via Python-list wrote:
It's been several years since I've needed to write a python script so I'm
asking for advice to get me started with a brief script to separate names
and email addresses in one file into two sepa
On Thu, 11 Jan 2024, Mats Wichmann via Python-list wrote:
4. Don't assume it's going to be "plain text" if the email info is
harvested from external sources (like incoming emails) - you'll end up
stumbling over a 誰かのユーザー from somewhere. Process as bytes, or be
really careful about which encoding
On 11/01/2024 19.08, Rich Shepard wrote:
It's been several years since I've needed to write a python script so I'm
asking for advice to get me started with a brief script to separate names
and email addresses in one file into two separate files: salutation.txt and
emails.txt.
An example of the i
On Thu, 11 Jan 2024, Piergiorgio Sartor via Python-list wrote:
Why not to use bash script for all?
Piergiorgio,
That's certainly a possibility, and may well be better than python for this
task.
Thank you,
Rich
--
https://mail.python.org/mailman/listinfo/python-list
Am 11.01.24 um 20:53 schrieb Rich Shepard via Python-list:
On Thu, 11 Jan 2024, Piergiorgio Sartor via Python-list wrote:
Why not to use bash script for all?
Piergiorgio,
That's certainly a possibility, and may well be better than python
for this
task.
Thank you,
Rich
awk '/@/ {print >
On 1/11/2024 1:27 PM, MRAB via Python-list wrote:
On 2024-01-11 18:08, Rich Shepard via Python-list wrote:
It's been several years since I've needed to write a python script so I'm
asking for advice to get me started with a brief script to separate names
and email addresses in one file into two
By the way, in an attempt to golf this problem, I discovered this,
which seems like a parser problem:
This is what Python tells me about its grammar:
with_stmt:
| 'with' '(' ','.with_item+ ','? ')' ':' block
| 'with' ','.with_item+ ':' [TYPE_COMMENT] block
| ASYNC 'with' '(' ','.with_
Ah, nevermind. I need to be more careful, there isn't an "'as'
star_target" after the first rule.
On Thu, Jan 11, 2024 at 10:33 PM Left Right wrote:
>
> By the way, in an attempt to golf this problem, I discovered this,
> which seems like a parser problem:
>
> This is what Python tells me about i
On 12/01/24 10:33, Left Right via Python-list wrote:
By the way, in an attempt to golf this problem, I discovered this,
which seems like a parser problem:
This is what Python tells me about its grammar:
with_stmt:
| 'with' '(' ','.with_item+ ','? ')' ':' block
| 'with' ','.with_item+
On Fri, 12 Jan 2024 at 08:56, Left Right via Python-list
wrote:
>
> By the way, in an attempt to golf this problem, I discovered this,
> which seems like a parser problem:
When you jump immediately to "this is a bug", all you do is make
yourself look like an idiot. Unsurprisingly, this is NOT a b
On 12/01/24 12:56, Chris Angelico via Python-list wrote:
On Fri, 12 Jan 2024 at 08:56, Left Right via Python-list
wrote:
By the way, in an attempt to golf this problem, I discovered this,
which seems like a parser problem:
When you jump immediately to "this is a bug", all you do is make
"s
Thursday, January 11, 2024 at 10:44, Rich Shepard via Python-list wrote:
Re: Extract lines from file, add to (at least in part)
>On Thu, 11 Jan 2024, MRAB via Python-list wrote:
>> From the look of it:
>> 1. If the line is empty, ignore it.
>> 2. If the line contains "@", it's an email address.
15 matches
Mail list logo