parameters: (self, line)
docstring: Replace stdout and stderr with StringIO to
          save output of the command.
          Input:
              line: str: line to be interpreted
docstring_summary: Replace stdout and stderr with StringIO to
          save output of the command.
          Input:
              line: str: line to be interpreted
docstring_tokens: Replace stdout and stderr with StringIO to save output of the command . Input : line : str : line to be interpreted
function: def _newLine(self, line):
          """
          Replace stdout and stderr with StringIO to
          save output of the command.
          Input:
              line: str: line to be interpreted
          """
          old_stdout = sys.stdout
          old_stderr = sys.stderr
          output = StringIO()
          sys.stdout = output
          sys.stderr = output
          try:
              # push the line to the interpreter
              self.more = self.console.push(str(line))
          finally:
              sys.stdout = old_stdout
              sys.stderr = old_stderr
              self.write_output.emit(str(output.getvalue().rstrip()))
          self._setPrompt()
function_tokens: def _newLine ( self , line ) : old_stdout = sys . stdout old_stderr = sys . stderr output = StringIO ( ) sys . stdout = output sys . stderr = output try : # push the line to the interpreter self . more = self . console . push ( str ( line ) ) finally : sys . stdout = old_stdout sys . stderr = old_stderr self . write_output . emit ( str ( output . getvalue ( ) . rstrip ( ) ) ) self . _setPrompt ( )