On Sat, Aug 7, 2021 at 5:22 AM Boris Dorestand wrote:
>
> Jach Feng writes:
>
> >> > s = "Jack Brandom"
> >> > s[3 : -13 : -1]
> >> >> 'kcaJ'
> >> >> I have no idea how to replace that -13 with a positive index. Is it
> >> >> possible at all?
> > That's not possible because a positive ind
Jach Feng writes:
>> > s = "Jack Brandom"
>> > s[3 : -13 : -1]
>> >> 'kcaJ'
>> >> I have no idea how to replace that -13 with a positive index. Is it
>> >> possible at all?
> That's not possible because a positive index is relative to the leftmost item > 0
And the middle index is al
Il 06/08/2021 12:57, Jach Feng ha scritto:
jak 在 2021年8月6日 星期五下午4:10:05 [UTC+8] 的信中寫道:
Il 05/08/2021 11:40, Jach Feng ha scritto:
I want to distinguish between numbers with/without a dot attached:
text = 'ch 1. is\nch 23. is\nch 4 is\nch 56 is\n'
re.compile(r'ch \d{1,}[.]').findall(text)
['c
On 2021-08-06, jak wrote:
> Il 06/08/2021 16:17, jak ha scritto:
>> Il 06/08/2021 12:57, Jach Feng ha scritto:
>>> That's an interest solution! Where the '|' operator in re.compile()
>>> was documented?
>>
>> I honestly can't tell you, I've been using it for over 30 years. In any
>> case you can
jak 在 2021年8月6日 星期五下午4:10:05 [UTC+8] 的信中寫道:
> Il 05/08/2021 11:40, Jach Feng ha scritto:
> > I want to distinguish between numbers with/without a dot attached:
> >
> text = 'ch 1. is\nch 23. is\nch 4 is\nch 56 is\n'
> re.compile(r'ch \d{1,}[.]').findall(text)
> > ['ch 1.', 'ch 23.']
Il 06/08/2021 16:17, jak ha scritto:
Il 06/08/2021 12:57, Jach Feng ha scritto:
jak 在 2021年8月6日 星期五下午4:10:05 [UTC+8] 的信中寫道:
Il 05/08/2021 11:40, Jach Feng ha scritto:
I want to distinguish between numbers with/without a dot attached:
text = 'ch 1. is\nch 23. is\nch 4 is\nch 56 is\n'
re.compi
ast 在 2021年8月5日 星期四下午11:29:15 [UTC+8] 的信中寫道:
> Le 05/08/2021 à 17:11, ast a écrit :
> > Le 05/08/2021 à 11:40, Jach Feng a écrit :
> >> I want to distinguish between numbers with/without a dot attached:
> >>
> > text = 'ch 1. is\nch 23. is\nch 4 is\nch 56 is\n'
> > re.compile(r'ch \d{1,
Il 05/08/2021 11:40, Jach Feng ha scritto:
I want to distinguish between numbers with/without a dot attached:
text = 'ch 1. is\nch 23. is\nch 4 is\nch 56 is\n'
re.compile(r'ch \d{1,}[.]').findall(text)
['ch 1.', 'ch 23.']
re.compile(r'ch \d{1,}[^.]').findall(text)
['ch 23', 'ch 4 ', 'ch 56 '
> > s = "Jack Brandom"
> > s[3 : -13 : -1]
> >> 'kcaJ'
> >> I have no idea how to replace that -13 with a positive index. Is it
> >> possible at all?
That's not possible because a positive index is relative to the leftmost item 0
Below is some rules of slice usage which I collected so
"Michael F. Stemper" writes:
> On 05/08/2021 12.35, Jack Brandom wrote:
>> The FAQ at
>>https://docs.python.org/3/faq/programming.html#what-s-a-negative-index
>> makes me think that I can always replace negative indices with
>> positive
>> ones --- even in slices, although the FAQ seems not t
On 05/08/2021 12.35, Jack Brandom wrote:
The FAQ at
https://docs.python.org/3/faq/programming.html#what-s-a-negative-index
makes me think that I can always replace negative indices with positive
ones --- even in slices, although the FAQ seems not to say anything
about slices.
With slices, i
The FAQ at
https://docs.python.org/3/faq/programming.html#what-s-a-negative-index
makes me think that I can always replace negative indices with positive
ones --- even in slices, although the FAQ seems not to say anything
about slices.
With slices, it doesn't seem to always work. For insta
Le 06/08/2021 à 02:57, Jach Feng a écrit :
ast 在 2021年8月5日 星期四下午11:29:15 [UTC+8] 的信中寫道:
Le 05/08/2021 à 17:11, ast a écrit :
Le 05/08/2021 à 11:40, Jach Feng a écrit :
import regex
# regex is more powerful that re
text = 'ch 1. is\nch 23. is\nch 4 is\nch 56 is\n'
regex.findall(r'ch \d++(?!
03.08.21 13:03, Bartosz Golaszewski пише:
> Just a follow-up: this is how I did it eventually:
I think it can be simpler.
1. No need to create the __main__ module. You can just create a dict. If
some attributes are required (e.g. __name__) it is easy to set them in
the Python code (__name__ = 'py
On 2021-08-06 16:50, Suretha Weweje wrote:
I am trying to upload a CSV file with flask, read and process one line at a
time while iterating through all rows of the file and write the results
back to a new CSV file. My python script produces the correct results on
its own, but I am not able to ge
I am trying to upload a CSV file with flask, read and process one line at a
time while iterating through all rows of the file and write the results
back to a new CSV file. My python script produces the correct results on
its own, but I am not able to get the same results when using Flask. I am
new
16 matches
Mail list logo