title: How to make IME(Input Method Editor) simulator by python?
body: <pre><code>def IME(self) : #it is total function
      output = ""
      print "Exit by ctrl + D"
      while 1 :
          character = raw_input("")
          if character in self.alphabet :
              result = self.transition(character) # get result [next state, output character] from constructed by automata
              output = output + str(result[1])
              print output
              self.currentState = result[0]
          else :
              output = output + character
              print output
  
  
      self.currentState = 0
  </code></pre>
  
  <p>I make a IME(Input Method Editor) simulator by python. It is like finite state machine, when input come and output shows result on python program. I don't know the result show one by one, so I want to ask you how to show just like command line style.</p>
  
  <p>The Question is two things,</p>
  
  <ol>
  <li>How to express each result one by one?</li>
  <li>How to implement "space" or "backspace"?</li>
  <li><p>Is it okay using this code when 'del(backspace) key' input?</p>
  
  <pre><code>    elif character == '\033'
          output = output[0:len(output)-1]
  </code></pre></li>
  </ol>