Capture the outcome of Python function calls
