I am running gnu linux (Linux Mint to be specific). The following is my desired workflow:
- I open vim in (say) process 1000 and then start up a python interpreter in process 1001.
- I write some code in vim and then select certain lines and then write those lines to the file
/proc/1001/fd/0
. - At this point I would like the python interpreter to interpret this as code and execute it as if it were typed in directly.
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).
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.