On Thu, Mar 2, 2023 at 9:56 PM Alan Bawden wrote:
>
> jose isaias cabrera writes:
>
>On Thu, Mar 2, 2023 at 2:38 PM Mats Wichmann wrote:
>
>This re is a bit different than the one I am used. So, I am trying to match
>everything after 'pn=':
>
>import re
>s = "pm=jose pn=2017"
On Thu, Mar 2, 2023 at 8:35 PM wrote:
>
> It is a well-known fact, Jose, that GIGO.
>
> The letters "n" and "m" are not interchangeable. Your pattern fails because
> you have "pn" in one place and "pm" in the other.
It is not GIGO. pm=project manager. pn=project name. I needed search()
rather th
On Thu, Mar 2, 2023 at 8:30 PM Cameron Simpson wrote:
>
> On 02Mar2023 20:06, jose isaias cabrera wrote:
> >This re is a bit different than the one I am used. So, I am trying to
> >match
> >everything after 'pn=':
> >
> >import re
> >s = "pm=jose pn=2017"
> >m0 = r"pn=(.+)"
> >r0 = re.compile(m0)
jose isaias cabrera writes:
On Thu, Mar 2, 2023 at 2:38 PM Mats Wichmann wrote:
This re is a bit different than the one I am used. So, I am trying to match
everything after 'pn=':
import re
s = "pm=jose pn=2017"
m0 = r"pn=(.+)"
r0 = re.compile(m0)
s0 = r0.match(s)
>>
On 02Mar2023 20:06, jose isaias cabrera wrote:
This re is a bit different than the one I am used. So, I am trying to
match
everything after 'pn=':
import re
s = "pm=jose pn=2017"
m0 = r"pn=(.+)"
r0 = re.compile(m0)
s0 = r0.match(s)
`match()` matches at the start of the string. You want r0.se
It is a well-known fact, Jose, that GIGO.
The letters "n" and "m" are not interchangeable. Your pattern fails because you
have "pn" in one place and "pm" in the other.
>>> s = "pn=jose pn=2017"
...
>>> s0 = r0.match(s)
>>> s0
-Original Message-
From: Python-list On
Behalf Of jose
On Thu, Mar 2, 2023 at 2:38 PM Mats Wichmann wrote:
>
> On 3/2/23 12:28, Chris Angelico wrote:
> > On Fri, 3 Mar 2023 at 06:24, jose isaias cabrera
wrote:
> >>
> >> Greetings.
> >>
> >> For the RegExp Gurus, consider the following python3 code:
> >>
> >> import re
> >> s = "pn=align upgrade sd=2
Greg Ewing writes:
> On 2/03/23 10:59 am, gene heskett wrote:
>> Human skin always has the same color
>
> Um... no?
You took that out of context. The assertion was that "Human skin
always has the same color" and "the difference is not the color,
but the brightness". I offer no opinion on whethe
My understanding is that python created functions like type() and len() as a
general purpose way to get information and ALSO set up a protocol that
classes can follow by creating dunder methods. I think the most pythonic
things is to avoid directly calling the dunder methods with a few exceptions
t
On 3/2/2023 5:53 PM, Greg Ewing via Python-list wrote:
On 3/03/23 9:54 am, Ian Pilcher wrote:
I haven't found
anything that talks about which form is considered to be more Pythonic
in those situations where there's no functional difference.
In such cases I'd probably go for type(x), because it
On 2023-03-02, Peter J. Holzer wrote:
> [1] Personally I'd say you shouldn't use Outlook if you are reading
> mails where line breaks (or other formatting) is important, but ...
I'd shorten that to
"You shouldn't use Outlook if mail is important."
--
https://mail.python.org/mailman/listin
Thanks, Peter. Excellent advice, even if only for any of us using Microsoft
Outlook as our mailer. I made the changes and we will see but they should
mainly impact what I see. I did tweak another parameter.
The problem for me was finding where they hid the options menu I needed.
Then, I started tr
On 3/03/23 9:54 am, Ian Pilcher wrote:
I haven't found
anything that talks about which form is considered to be more Pythonic
in those situations where there's no functional difference.
In such cases I'd probably go for type(x), because it looks less
ugly.
x.__class__ *might* be slightly more
José,
Matching can be greedy. Did it match to the last space?
What you want is a pattern that matches anything except a space (or whitespace)
followed b matching a space or something similar.
Or use a construct that makes matching non-greedy.
Avi
-Original Message-
From: Python-list
On 3/2/2023 3:54 PM, Ian Pilcher wrote:
Seems like an FAQ, and I've found a few things on StackOverflow that
discuss the technical differences in edge cases, but I haven't found
anything that talks about which form is considered to be more Pythonic
in those situations where there's no functional
Seems like an FAQ, and I've found a few things on StackOverflow that
discuss the technical differences in edge cases, but I haven't found
anything that talks about which form is considered to be more Pythonic
in those situations where there's no functional difference.
Is there any consensus?
--
On 2023-03-01 01:01:42 +0100, Peter J. Holzer wrote:
> On 2023-02-28 15:25:05 -0500, avi.e.gr...@gmail.com wrote:
> > I had no doubt the code you ran was indented properly or it would not work.
> >
> > I am merely letting you know that somewhere in the process of copying
> > the code or the transi
On Thu, Mar 2, 2023 at 2:32 PM <2qdxy4rzwzuui...@potatochowder.com> wrote:
>
> On 2023-03-02 at 14:22:41 -0500,
> jose isaias cabrera wrote:
>
> > For the RegExp Gurus, consider the following python3 code:
> >
> > import re
> > s = "pn=align upgrade sd=2023-02-"
> > ro = re.compile(r"pn=(.+) ")
>
Haven’t look at it all in detail, but I’d replace the list comprehensions with
a loop:
CopyOfWords = list(Words)
Words = [(w[1:] if w[0] == ch else w) for w in Words]
Words = [w for w in Words if w != '']
nextWords = []
for w in CopyOfWords:
On 3/2/23 12:28, Chris Angelico wrote:
On Fri, 3 Mar 2023 at 06:24, jose isaias cabrera wrote:
Greetings.
For the RegExp Gurus, consider the following python3 code:
import re
s = "pn=align upgrade sd=2023-02-"
ro = re.compile(r"pn=(.+) ")
r0=ro.match(s)
print(r0.group(1))
align upgrade
T
On 2023-03-02 at 14:22:41 -0500,
jose isaias cabrera wrote:
> For the RegExp Gurus, consider the following python3 code:
>
> import re
> s = "pn=align upgrade sd=2023-02-"
> ro = re.compile(r"pn=(.+) ")
> r0=ro.match(s)
> >>> print(r0.group(1))
> align upgrade
>
>
> This is wrong. It should be
On Fri, 3 Mar 2023 at 06:24, jose isaias cabrera wrote:
>
> Greetings.
>
> For the RegExp Gurus, consider the following python3 code:
>
> import re
> s = "pn=align upgrade sd=2023-02-"
> ro = re.compile(r"pn=(.+) ")
> r0=ro.match(s)
> >>> print(r0.group(1))
> align upgrade
>
>
> This is wrong. I
Greetings.
For the RegExp Gurus, consider the following python3 code:
import re
s = "pn=align upgrade sd=2023-02-"
ro = re.compile(r"pn=(.+) ")
r0=ro.match(s)
>>> print(r0.group(1))
align upgrade
This is wrong. It should be 'align' because the group only goes up-to
the space. Thoughts? Thanks.
Slightly improved version (deals with multiple characters together
instead of one at a time):
# Pack.py
def Pack(Words):
if not Words:
return ''
# The method is to build up the result by adding letters at the
beginning
# and working forward, and by adding letters at the end,
I found Hen Hanna's "packing" problem to be an intriguing one: Given a
list of words:
['APPLE', 'PIE', 'APRICOT', 'BANANA', 'CANDY']
find a string (in general non-unique) as short as possible which
contains the letters of each of these words, in order, as a subsequence.
It struck me as being
On Thu, 2 Mar 2023 12:45:50 +1100, Chris Angelico
declaimed the following:
>
>As have all CPUs since; it's the only way to implement locks (push the
>locking all the way down to the CPU level).
>
Xerox Sigma (circa 1970): Modify and Test (byte/halfword/word)
Granted, that was a
On 2023-03-02, Stephen Tucker wrote:
> The range function in Python 2.7 (and yes, I know that it is now
> superseded), provokes a Memory Error when asked to deiliver a very long
> list of values.
>
> I assume that this is because the function produces a list which it then
> iterates through.
>
> 1
On Thu, 2 Mar 2023 at 22:27, Stephen Tucker wrote:
>
> Hi,
>
> The range function in Python 2.7 (and yes, I know that it is now
> superseded), provokes a Memory Error when asked to deiliver a very long
> list of values.
>
> I assume that this is because the function produces a list which it then
>
On 2023-03-02 at 11:25:49 +,
Stephen Tucker wrote:
> The range function in Python 2.7 (and yes, I know that it is now
> superseded), provokes a Memory Error when asked to deiliver a very long
> list of values.
>
> I assume that this is because the function produces a list which it then
> ite
Hi,
The range function in Python 2.7 (and yes, I know that it is now
superseded), provokes a Memory Error when asked to deiliver a very long
list of values.
I assume that this is because the function produces a list which it then
iterates through.
1. Does the range function in Python 3.x behav
30 matches
Mail list logo