<span class="q">&gt; &gt;&gt; In [4]:import array<br>&gt; &gt;&gt; In [5]:def f7(list):<br>&gt; &gt;&gt; &nbsp; &nbsp;.5.: &nbsp;return array.array(&#39;B&#39;, list).tostring()<br>&gt; &gt;&gt; &nbsp; &nbsp;.5.:<br>&gt; &gt;&gt;<br>&gt; &gt;&gt; In [6]:f7([97, 98, 99])
<br>&gt; &gt;&gt; Out[6]:&#39;abc&#39;<br><br><br><br><br>ugh the code it self is not generic python,&nbsp; 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 &quot;282&quot; 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 &#39;ll have is<br><br>a list of tuples, for instance&nbsp;&nbsp; [a, 222] , [b,333]&nbsp; 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()&nbsp; is a good solution, i haven&#39;t found a better one,<br>
<br>and the other bottle neck is this translation process.<br><br><br><br><br><br></span>