title: How can I compress ASCII art into RLE with run lengh of 2 (or decompress RLE into ascii in the same way)?
body: <p>I want to get a program or a function to compress ASCII art from a text file into RLE with a run length of 2, so it counts the amount of characters and displays it like so: <code>04662312x52c02z01 03a</code> (just an example), so that it takes 2 numbers then a character.</p>
  
  <pre><code>from collections import OrderedDict 
  def runLengthEncoding(input): 
      dict=OrderedDict.fromkeys(input, 0) 
      for ch in input: 
          dict[ch] += 1
      for key,value in dict.iteritems(): 
           output = output + key + str(value) 
      return output
  </code></pre>
  
  <p>Ive tried this code but it doesnt work for number characters (it reads <code>53405211c</code> as <code>"53405211", "c"</code> instead of <code>"53", "4" "05", "2"  "11", "c"</code>)</p>
  
  <p>If anyone could simplify this </p>