app.js and qlearner.py playing with stdin and stdout