py_capture_output function

Capture and return Python output