title: Enter Interactive Mode In Python
body: <p>I'm running my Python program and have a point where it would be useful to jump in and see what's going on, and then step out again. Sort of like a temporary console mode.</p>
  
  <p>In Matlab, I'd use the <a href="http://www.mathworks.com/help/matlab/ref/keyboard.html"><code>keyboard</code></a> command to do this, but I'm not sure what the command is in python.</p>
  
  <p>Is there a way to do this?</p>
  
  <p>For instance:</p>
  
  <pre><code>for thing in set_of_things:
      enter_interactive_mode_here()
      do_stuff_to(thing)
  </code></pre>
  
  <p>When <code>enter_interactive_mode()</code> calls, I'd like to go there, look around, and then leave and have the program continue running.</p>