<span class="q">> >> In [4]:import array<br>> >> In [5]:def f7(list):<br>> >> .5.: return array.array('B', list).tostring()<br>> >> .5.:<br>> >><br>> >> In [6]:f7([97, 98, 99])
<br>> >> Out[6]:'abc'<br><br><br><br><br>ugh the code it self is not generic python, that was an example of how to do this<br><br><br>my project is OCR<br><a href="http://www.eternite.co.uk/gundam_clips/ocr.PNG">
http://www.eternite.co.uk/gundam_clips/ocr.PNG</a><br><br></span><span class="postbody">
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 last one.
<br>
<br>
<br>
So the string would be translated into:
<br>
<br>
28201722030033330000004222400722240172206 and so on.
<br><br>#####################<br><br><br>so what I am going to have is a string like above and what I 'll have is<br><br>a list of tuples, for instance [a, 222] , [b,333] and so forth<br><br>how do I write the fastest code to do this
<br><br><br><br>optimization is immediately needed because the job is done as soon this translation is complete.<br><br><br>so two bottle neck<br><br>image.getdata() is a good solution, i haven't found a better one,<br>
<br>and the other bottle neck is this translation process.<br><br><br><br><br><br></span>