title: How to repeat last command in python interpreter shell?
body: <p>How do I repeat the last command? The usual keys: Up, Ctrl+Up, Alt-p don't work. They produce nonsensical characters.</p>
  
  <pre><code>(ve)[kakarukeys@localhost ve]$ python
  Python 2.6.6 (r266:84292, Nov 15 2010, 21:48:32) 
  [GCC 4.4.4 20100630 (Red Hat 4.4.4-10)] on linux2
  Type "help", "copyright", "credits" or "license" for more information.
  &gt;&gt;&gt; print "hello world"
  hello world
  &gt;&gt;&gt; ^[[A
    File "&lt;stdin&gt;", line 1
      ^
  SyntaxError: invalid syntax
  &gt;&gt;&gt; ^[[1;5A
    File "&lt;stdin&gt;", line 1
      [1;5A
      ^
  SyntaxError: invalid syntax
  &gt;&gt;&gt; ^[p
    File "&lt;stdin&gt;", line 1
      p
      ^
  SyntaxError: invalid syntax
  &gt;&gt;&gt; 
  </code></pre>