Jim Garrison wrote:
>It's a shame the iter(o,sentinel) builtin does the
>comparison itself, instead of being defined as iter(callable,callable)
>where the second argument implements the termination test and returns a
>boolean. This would seem to add much more generality... is
>it worthy of a PEP
venutaurus...@gmail.com wrote:
>FName = "TextFile"+c+"_"+d+"_"+p+".txt"
>l = 1
>for l in range(1 , 11):
>os.system ("\"echo "+FName+" >> "+FName+"\"")
>l = l +1
1. os.system spawns a new process, which on Windows (I'm guessing
you're on Windows give
Peter Otten <__pete...@web.de> wrote:
>assert s.startswith("[")
>assert s.endswith("]")
>s = s[1:-1]
s.strip('[]')
(I suppose it all depends on how much you can trust the consistency
of the input.)
--
\S
under construction
--
http://mail.python.org/mailman/listinfo/python-list
Iain King wrote:
>Sort of tangenitally; is there any real difference between the outcome
>of the two following pieces of code?
>
>a = lambda x: x+2
>
>def a(x):
>return x+2
a.__name__
As for why that matters, try a(None) and see which gives the more
informative traceback.
--
\S
under
Carl Banks wrote:
>When building a very large structure like you're doing, the cyclic
>garbage collector can be a bottleneck. Try disabling the cyclic
>garbage collector before building the large dictionary, and re-
>enabling it afterwards.
>
>import gc
>gc.disable()
>try:
>for line in file:
Avetis KAZARIAN wrote:
>It seems that any strict ASCII alpha-numeric string is instantiated as
>an unique object, like a "singleton" ( a =3D "x" and b =3D "x" =3D> a is b =
>)
>and that any non strict ASCII alpha-numeric string is instantiated as
>a new object every time with a new id.
What no-o
In article <3ed253bb-d6ec-4f47-af08-ad193e9c4...@h16g2000yqj.googlegroups.com>,
odeits wrote:
>def count_consecutive(rows):
>switch =3D 0
>count =3D 0
>for r in rows:
>if r[-1] =3D=3D switch:
>count +=3D 1
>else:
>switch =3D not switch
>