I\'d like to have real-time access to both interpreter input and error and standard output. Preferably this information would be written to a file, so that I can poll the fi
You can try and use my logging tool. It's not perfect yet but it solved my problem, which seems similar to your.
https://github.com/hholst80/loginteractive
It works by using LD_PRELOAD to pipe stdin.txt (or $STDIN) to stdout. It works for python and octave, although I have not tested it that much yet.