[Tutor] optimization: faster than for
hunter92383 at gmail.com
Mon Jul 2 08:47:02 CEST 2007
> >> In :import array
> >> In :def f7(list):
> >> .5.: return array.array('B', list).tostring()
> >> .5.:
> >> In :f7([97, 98, 99])
> >> Out:'abc'
ugh the code it self is not generic python, that was an example of how to
my project is OCR
The letter I equals to "282" because it has 2 points on the y axis of the
first point, and 8 points on the y axis on the second, and then 2 on the
So the string would be translated into:
28201722030033330000004222400722240172206 and so on.
so what I am going to have is a string like above and what I 'll have is
a list of tuples, for instance [a, 222] , [b,333] and so forth
how do I write the fastest code to do this
optimization is immediately needed because the job is done as soon this
translation is complete.
so two bottle neck
image.getdata() is a good solution, i haven't found a better one,
and the other bottle neck is this translation process.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Tutor