title: Linux: write to stdin of python interpreter process and have that process evaluate input as code
body: <p>I am running gnu linux (Linux Mint to be specific). The following is my desired workflow: </p>
  
  <ol>
  <li>I open vim in (say) process 1000 and then start up a python interpreter in process 1001. </li>
  <li>I write some code in vim and then select certain lines and then write those lines to the file <code>/proc/1001/fd/0</code>. </li>
  <li>At this point I would like the python interpreter to interpret this as code and execute it as if it were typed in directly.</li>
  </ol>
  
  <p>This does not work as desired. Instead the text is displayed on the interpreter's screen, but it is not executed (similar to when error messages of subprocesses are displayed in bash). I presume this has something to do with the fact that my workflow isn't playing well with readline (or some sort of equivalent library). Or my problem might just be that the python interpreter was never designed to be used this way (for presumably security and other reasons).</p>
  
  <p>I understand there are many IDEs with similar functionality, but I was hoping that something simple might work. I'm curious if it's something that can be fixed or if there is something fundamental that I'm misunderstanding.</p>