On 20/11/2018 22:35, Steven D'Aprano wrote:
> On Tue, Nov 20, 2018 at 08:22:01PM +, Alan Gauld via Tutor wrote:
>
>> I think that's a very deliberate feature of Python going back
>> to its original purpose of being a teaching language that
>> can be used beyond the classroom.
>
> I don't
On Tue, Nov 20, 2018 at 08:22:01PM +, Alan Gauld via Tutor wrote:
> I think that's a very deliberate feature of Python going back
> to its original purpose of being a teaching language that
> can be used beyond the classroom.
I don't think that is correct -- everything I've read is that
On 20/11/2018 18:08, Avi Gross wrote:
We have two completely separate ways to format strings that end up with fairly
similar functionality. Actually, there is an implicit third way
You could argue five ways :-)
1. C printf style formatting
On 20/11/2018 18:08, Avi Gross wrote:
> ... So there isn’t really ONE pythonic way for many things.
That's true and, I think, inevitable for anything developed
in the open source world. If you compare it to a language
entirely controlled by a single mind - like Oberon or Eiffel
say - then there
This is not a question or reply. Nor is it short. If not interested, feel free
to delete.
It is an observation based on recent experiences.
We have had quite a few messages that pointed out how some people approach
solving a problem using subconscious paradigms inherited from their
Hello,
My code is -
l = len(m)
item = str(m[1])
for i in range(2,l):
item = item + - + str(m[i])
This code is part of a bigger function. It works fine. But I am not happy
with the way I have written it. I think there is a better (Pythonic) way to
rewrite it.
If anyone knows how to improve
spa...@gmail.com wrote:
Hello,
My code is -
l = len(m)
item = str(m[1])
for i in range(2,l):
item = item + - + str(m[i])
This code is part of a bigger function. It works fine. But I am not happy
with the way I have written it. I think there is a better (Pythonic) way to
rewrite it.
If
Hello Steven,
Thanks a lot for the detailed answer. I will implement your suggestions.
Really appreciate it.
Thanks and Regards,
Sumod
On Fri, Jan 27, 2012 at 4:34 AM, Steven D'Aprano st...@pearwood.infowrote:
spa...@gmail.com wrote:
Hello,
My code is -
l = len(m)
item = str(m[1])
for
Hi Steven,
(5) When assembling strings from substrings, never use repeated concatenation
using + as that can be EXTREMELY slow. Use str.join to build the string in
one assignment, instead of multiple assignments.
Your code shown above is *very* inefficient and will be PAINFULLY slow if m
Le Fri, 08 May 2009 13:03:47 -0400,
pyt...@bdurham.com s'exprima ainsi:
[...]
Approaches:
1. split text to list of lines that get stripped then:
a. walk this list building a new list of lines that track and
ignore extra blank lines
-OR-
b. re-join lines and replace '\n\n\n' wth' \n\n' until
Note: Following cross-posted to python-list where it got queued
due to suspicious subject line.
I'm looking for suggestions on technique (not necessarily code)
about the most pythonic way to normalize vertical whitespace in
blocks of text so that there is never more than 1 blank line
between
pyt...@bdurham.com wrote:
Note: Following cross-posted to python-list where it got queued due to
suspicious subject line.
I'm looking for suggestions on technique (not necessarily code) about
the most pythonic way to normalize vertical whitespace in blocks of
text so that there is never more
On Fri, May 8, 2009 at 1:03 PM, pyt...@bdurham.com wrote:
Note: Following cross-posted to python-list where it got queued due to
suspicious subject line.
I'm looking for suggestions on technique (not necessarily code) about the
most pythonic way to normalize vertical whitespace in blocks of
Suggestions on the best way to extract delimited substrings strings from
a larger string?
Background: I have a long multi-line string with expressions delimited
with '(' and ')' markers. I would like to extract these substrings and
process them in a loop.
Because the left and right delimiters
Malcolm Greene wrote:
Suggestions on the best way to extract delimited substrings strings from
a larger string?
Background: I have a long multi-line string with expressions delimited
with '(' and ')' markers. I would like to extract these substrings and
process them in a loop.
What
Malcolm Greene [EMAIL PROTECTED] wrote in
Background: I have a long multi-line string with expressions
delimited
with '(' and ')' markers. I would like to extract these substrings
and
process them in a loop.
I know how to do this task with regular expressions, but I'm always
cautious
Hello,
I have a block of code buried deep in a module that I expect to fail
periodically. (Calls to other machines over slow network, and such.)
Generally, though, trying it a second / third will work.
Is there clean way to write this on Python?
Thanks
Allen Fowler [EMAIL PROTECTED] wrote
I have a block of code buried deep in a module
that I expect to fail periodically.
(Calls to other machines over slow network, and such.)
Generally, though, trying it a second / third will work.
Is there clean way to write this on Python?
There
On Friday 26 October 2007 03:17:47 pm Alan Gauld wrote:
Allen Fowler [EMAIL PROTECTED] wrote
I have a block of code buried deep in a module
that I expect to fail periodically.
(Calls to other machines over slow network, and such.)
Generally, though, trying it a second / third will
19 matches
Mail list logo