Chris Rebert c...@rebertia.com writes:
Python 2.6 (r26:66714, Nov 18 2008, 21:48:52)
[GCC 4.0.1 (Apple Inc. build 5484)] on darwin
Type help, copyright, credits or license for more information.
bool(-1)
True
str.find() returns -1 on failure (i.e. if the substring is not in the
given
Chris Rebert c...@rebertia.com writes:
Python 2.6 (r26:66714, Nov 18 2008, 21:48:52)
[GCC 4.0.1 (Apple Inc. build 5484)] on darwin
Type help, copyright, credits or license for more information.
bool(-1)
True
str.find() returns -1 on failure (i.e. if the substring is not in the
given
str.find() returns -1 on failure (i.e. if the substring is not in the
given string).
-1 is considered boolean true by Python.
That's an odd little quirk... never noticed that before.
I just use regular expressions myself.
Wouldn't this be something worth cleaning up? It's a little
J Kenneth King wrote:
Chris Rebert c...@rebertia.com writes:
Python 2.6 (r26:66714, Nov 18 2008, 21:48:52)
[GCC 4.0.1 (Apple Inc. build 5484)] on darwin
Type help, copyright, credits or license for more information.
bool(-1)
True
str.find() returns -1 on failure (i.e. if the substring
J Kenneth King wrote:
Chris Rebert c...@rebertia.com writes:
Python 2.6 (r26:66714, Nov 18 2008, 21:48:52)
[GCC 4.0.1 (Apple Inc. build 5484)] on darwin
Type help, copyright, credits or license for more information.
bool(-1)
True
str.find() returns -1 on failure (i.e. if the substring is
Stephen Hansen apt.shan...@gmail.com writes:
str.find() returns -1 on failure (i.e. if the substring is not in the
given string).
-1 is considered boolean true by Python.
That's an odd little quirk... never noticed that before.
I just use regular expressions myself.
Wouldn't this be
I'm only curious if it's worth cleaning up because the OP's case is one
where there is more than one way to do it.
I just think at this point .find is just not the right method to use;
substring in string is the way to determine what he wants is all.
.find is useful for when you want the
Quoth Stephen Hansen apt.shan...@gmail.com:
I just think at this point .find is just not the right method to use;
substring in string is the way to determine what he wants is all.
.find is useful for when you want the actual position, not when you just
want to determine if there's a match at
On Feb 1, 3:37 am, Peter Otten __pete...@web.de wrote:
Hussein B wrote:
Hey,
I have a log file that doesn't contain the word Haskell at all, I'm
just trying to do a little performance comparison:
++
from datetime import time, timedelta, datetime
start = datetime.now()
Jason Scheirer wrote:
On Feb 1, 3:37 am, Peter Otten __pete...@web.de wrote:
Hussein B wrote:
Hey,
I have a log file that doesn't contain the word Haskell at all, I'm
just trying to do a little performance comparison:
++
from datetime import time, timedelta, datetime
Chris Rebert c...@rebertia.com writes:
Python 2.6 (r26:66714, Nov 18 2008, 21:48:52)
[GCC 4.0.1 (Apple Inc. build 5484)] on darwin
Type help, copyright, credits or license for more information.
bool(-1)
True
str.find() returns -1 on failure (i.e. if the substring is not in the
given
Chris Rebert c...@rebertia.com writes:
Python 2.6 (r26:66714, Nov 18 2008, 21:48:52)
[GCC 4.0.1 (Apple Inc. build 5484)] on darwin
Type help, copyright, credits or license for more information.
bool(-1)
True
str.find() returns -1 on failure (i.e. if the substring is not in the
given
On Sun, Feb 1, 2009 at 3:22 AM, Hussein B hubaghd...@gmail.com wrote:
Hey,
I have a log file that doesn't contain the word Haskell at all, I'm
just trying to do a little performance comparison:
++
from datetime import time, timedelta, datetime
start = datetime.now()
print start
Hussein B wrote:
Hey,
I have a log file that doesn't contain the word Haskell at all, I'm
just trying to do a little performance comparison:
++
from datetime import time, timedelta, datetime
start = datetime.now()
print start
lines = [line for line in
Hey,
I have a log file that doesn't contain the word Haskell at all, I'm
just trying to do a little performance comparison:
++
from datetime import time, timedelta, datetime
start = datetime.now()
print start
lines = [line for line in file('/media/sda4/Servers/Apache/
15 matches
Mail list logo