I am also not sure how A triggers B. As far as I know that A is written in python and it invokes the script(B) we pass on. My script B just lies between A and C in order to create environment and result parsing for script C.
I am currently looking into your suggestions and will update whether it works or not.
Comment on Re^2: Capturing output of qx// without waiting for completion