'process the input, capturing stdout'

def process_input_line(self, line, store_history=True):

    stdout = sys.stdout
    splitter = self.IP.input_splitter
    try:
        sys.stdout = self.cout
        splitter.push(line)
        more = splitter.push_accepts_more()
        if (not more):
            source_raw = splitter.raw_reset()
            self.IP.run_cell(source_raw, store_history=store_history)
    finally:
        sys.stdout = stdout
