Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

If it smells it's chemistry, if it crawls it's biology, if it doesn't work it's physics.


devel / comp.lang.python / Re: Extract lines from file, add to new files

SubjectAuthor
o Re: Extract lines from file, add to new filesdn

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

<mailman.15.1705034108.15798.python-list@python.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=24813&group=comp.lang.python#24813

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.nntp4.net!usenet.goja.nl.eu.org!3.eu.feeder.erje.net!feeder.erje.net!fu-berlin.de!uni-berlin.de!not-for-mail
From: PythonL...@DancesWithMice.info (dn)
Newsgroups: comp.lang.python
Subject: Re: Extract lines from file, add to new files
Date: Fri, 12 Jan 2024 17:34:56 +1300
Organization: DWM
Lines: 45
Message-ID: <mailman.15.1705034108.15798.python-list@python.org>
References: <5a6d88e-46b1-a3ea-333-d053cbe5654d@appl-ecosys.com>
<24aeb00e-41fd-4809-ae96-d429645cbc07@mrabarnett.plus.com>
<a9577a3f-68d6-433b-b87c-4502e2041696@tompassin.net>
<CAJQBtgnNHtX+16LEyCh-GQATCR0Yp-7zaKJaG3y-gyh7+nZJAg@mail.gmail.com>
<CAPTjJmqx3aDeSDYXDiT7xSSLtJUYzqzc4zY7f16w9VGJYsXE-g@mail.gmail.com>
<75950bec-a404-4de8-94aa-b8ab1eeede04@DancesWithMice.info>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.uni-berlin.de qtAazXOodJssDFltqeCiiQspGewWrj/DgEojivuuP6mw==
Cancel-Lock: sha1:lOXGtCmboNsZBqXoZsNeqiWOFFg= sha256:lujF7HlM5tzr3T7jl/BJpDGGhpOpaVYwnpE0cA4u9+w=
Return-Path: <PythonList@DancesWithMice.info>
X-Original-To: python-list@python.org
Delivered-To: python-list@mail.python.org
Authentication-Results: mail.python.org; dkim=pass
reason="2048-bit key; unprotected key"
header.d=danceswithmice.info header.i=@danceswithmice.info
header.b=PeMNcrHU; dkim-adsp=pass; dkim-atps=neutral
X-Spam-Status: OK 0.002
X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'clarify': 0.07;
'subject:add': 0.07; '=dn': 0.09; 'angelico': 0.09; 'aspect':
0.09; 'from:addr:danceswithmice.info': 0.09;
'from:addr:pythonlist': 0.09; 'hat': 0.09;
'received:192.168.1.64': 0.09; 'subject:files': 0.09; 'text.':
0.09; 'coding': 0.13; '(plus,': 0.16; "(there's": 0.16; '(yes':
0.16; '2024': 0.16; 'bug,': 0.16; 'indeed': 0.16; 'instead.':
0.16; 'message-id:@DancesWithMice.info': 0.16; 'received:51.254':
0.16; 'received:51.254.211': 0.16; 'received:51.254.211.219':
0.16; 'received:cloud': 0.16; 'received:rangi.cloud': 0.16;
'rude': 0.16; 'studied': 0.16; 'them?': 0.16; 'which,': 0.16;
'wrote:': 0.16; 'probably': 0.17; 'to:addr:python-list': 0.20;
'fri,': 0.22; 'problem,': 0.22; 'subject:file': 0.22; 'science':
0.22; 'code': 0.23; 'goal': 0.23; 'python,': 0.25; 'seems': 0.26;
"isn't": 0.27; 'chris': 0.28; 'thinking': 0.28; 'computer': 0.29;
'header:User-Agent:1': 0.30; 'attempt': 0.31; 'comment': 0.31;
'header:Organization:1': 0.31; 'think': 0.32; '"this': 0.32;
'python-list': 0.32; 'received:192.168.1': 0.32; 'but': 0.32;
'same': 0.34; "didn't": 0.34; 'header:In-Reply-To:1': 0.34;
'yes,': 0.35; 'those': 0.36; 'subject:from': 0.37; 'really': 0.37;
"it's": 0.37; 'others': 0.37; 'this.': 0.37; 'received:192.168':
0.37; 'read': 0.38; 'text': 0.39; 'this,': 0.39; 'on.': 0.39;
'learn': 0.40; 'want': 0.40; 'english': 0.60; 'likely': 0.61;
'skip:i 20': 0.62; 'simply': 0.63; 'received:51': 0.64; 'look':
0.65; 'well': 0.65; 'worked': 0.67; 'back': 0.67; 'credit': 0.67;
'right': 0.68; 'took': 0.69; 'easy': 0.74; 'read,': 0.75;
'yourself': 0.75; 'discovered': 0.80; 'left': 0.83; 'golf': 0.84;
'grammar': 0.91
DKIM-Filter: OpenDKIM Filter v2.11.0 vps.rangi.cloud E3A2C4F1B
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=danceswithmice.info;
s=staff; t=1705034100;
bh=DV3NuwErTFx4o1dkPgrwSoE3IuavFmGRMUT7yBKCG0o=;
h=Date:From:Subject:To:References:In-Reply-To:From;
b=PeMNcrHUdhFdBdnWC5blygqLsiq9Z5Fx5fJpRadd2DZxeypYqAoBvOytZ0EOQHIqT
g+fMO9geLd257YV1xiuH8QgHGpobTc2gESLb9E/RErgMoYN/MclO/CxhoXNuP4v57/
IWTzpV0KtjKoVqQoHjaaUfPOAj2HrLQuVbdHFGtQqVSKcAFaXr0s5WqrlWNG8rrm7W
LLygd4OU5NTBYJTWUTB89kbIoDXmMmh9vA/dQCfZ+5t+SdwaPUm0wCwVrcZwG+sBjt
YLvtGvmImOhrwc40pRuXzLFbTMnkZ5LeOAekPlIz1Bvt2rg60kZWLJs2GLpery4JII
F7nJaGq/jlRRA==
User-Agent: Mozilla Thunderbird
Content-Language: en-US
In-Reply-To: <CAPTjJmqx3aDeSDYXDiT7xSSLtJUYzqzc4zY7f16w9VGJYsXE-g@mail.gmail.com>
X-BeenThere: python-list@python.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: General discussion list for the Python programming language
<python-list.python.org>
List-Unsubscribe: <https://mail.python.org/mailman/options/python-list>,
<mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive: <https://mail.python.org/pipermail/python-list/>
List-Post: <mailto:python-list@python.org>
List-Help: <mailto:python-list-request@python.org?subject=help>
List-Subscribe: <https://mail.python.org/mailman/listinfo/python-list>,
<mailto:python-list-request@python.org?subject=subscribe>
X-Mailman-Original-Message-ID: <75950bec-a404-4de8-94aa-b8ab1eeede04@DancesWithMice.info>
X-Mailman-Original-References: <5a6d88e-46b1-a3ea-333-d053cbe5654d@appl-ecosys.com>
<24aeb00e-41fd-4809-ae96-d429645cbc07@mrabarnett.plus.com>
<a9577a3f-68d6-433b-b87c-4502e2041696@tompassin.net>
<CAJQBtgnNHtX+16LEyCh-GQATCR0Yp-7zaKJaG3y-gyh7+nZJAg@mail.gmail.com>
<CAPTjJmqx3aDeSDYXDiT7xSSLtJUYzqzc4zY7f16w9VGJYsXE-g@mail.gmail.com>
 by: dn - Fri, 12 Jan 2024 04:34 UTC

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
> <python-list@python.org> 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

"seems"!

but yes, it is a (much) less-likely explanation.

> yourself look like an idiot. Unsurprisingly, this is NOT a bug, this
> is simply that you didn't understand what was going on. The grammar
> isn't easy to read, and it's usually better to read the documentation
> instead.

Those of us who studied Computer Science may well have been
taught/expected to learn how to read [modified] BNF - indeed to have
worked in that (cf coding in Python).

Accordingly, the English text is likely easier to understand, but
sometimes the BNF offers finer-detail or can be used to clarify some
mis- or insufficiently-understood aspect of the text. IMHO/YMMV/etc...

> (Plus, golfing isn't really a goal in Python, and you didn't shorten
> the code by much at all. Good job.)

I took my hat off to the poster, being prepared to dive-in and do this.
Accordingly, was more than happy to help set him/her back onto 'the
straight and narrow'.

(yes it was a BNF-failing - which, credit where credit's due, I think
was realised at the same time as response was typed)

How many others just want us to do all their thinking for them?
(there's a rude comment about wiping noses - but probably a step too far
wrt the CoC)

--
Regards,
=dn

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor