String functions: what's the difference?
Harro de Jong
h.c.de.jong at xxxxmsnet.nl.invalid
Thu Mar 9 11:16:15 EST 2006
<gry at ll.mit.edu> wrote:
> One suggestion: when asking questions here it's a good idea to always
> briefly mention which version of python and what platform (linux,
> windows, etc) you're using.
Of course, forgot about that. It's Python 2.4.2 for Windows.
>
> For testing performance the "timeit" module is great. Try something
> like:
> python -mtimeit -s 'import string;from myfile import isLower'
> "isLower('x')"
Thanks for the pointer. I was using time.time(), which I now see isn't
very accurate on Windows.
>
> You didn't mention the test data, i.e. the character you're feeding to
> isLower.
> It might make a difference if the character is near the beginning or
> end of the range.
(slaps forehead) I used "A" as the input, of course that would make a
difference.
...
> Have fun with python!
If the few days I've spent on it so far are any indication, I will. This
is my first foray into programming since college; I like 'How to Think
Like a Computer Scientist' much better than my impenetrable C textbook.
--
Harro de Jong
remove the extra Xs from xmsnet to mail me
More information about the Python-list
mailing list