title: Python command line: editing mistake on previous line?
body: <p>When using python via the command line, if I see a mistake on a previous line of a nested statement is there any way to remove or edit that line once it has already been entered?</p>
  
  <p>e.g.:</p>
  
  <pre><code>&gt;&gt;&gt; file = open("file1", "w")
  &gt;&gt;&gt; for line in file:
  ...     parts = line.split('|')   &lt;-- example, I meant to type '\' instead
  ...     print parts[0:1]
  ...     print ";"
  ...     print parts[1:]
  </code></pre>
  
  <p>so rather than retyping the entire thing all over to fix one char, can I go back and edit something in hindsight?
  I know I could just code it up in vim or something and have a persistent copy I can do anything I want with, but I was hoping for a handy-dandy trick with the command line.</p>
  
  <p>-- thanks! </p>