parameters: (self, escape_character=chr(29),
              input_filter=None, output_filter=None)
docstring: This gives control of the child process to the interactive user (the
          human at the keyboard). Keystrokes are sent to the child process, and
          the stdout and stderr output of the child process is printed. This
          simply echos the child stdout and child stderr to the real stdout and
          it echos the real stdin to the child stdin. When the user types the
          escape_character this method will return None. The escape_character
          will not be transmitted.  The default for escape_character is
          entered as ``Ctrl - ]``, the very same as BSD telnet. To prevent
          escaping, escape_character may be set to None.
  
          If a logfile is specified, then the data sent and received from the
          child process in interact mode is duplicated to the given log.
  
          You may pass in optional input and output filter functions. These
          functions should take bytes array and return bytes array too. Even
          with ``encoding='utf-8'`` support, meth:`interact` will always pass
          input_filter and output_filter bytes. You may need to wrap your
          function to decode and encode back to UTF-8.
  
          The output_filter will be passed all the output from the child process.
          The input_filter will be passed all the keyboard input from the user.
          The input_filter is run BEFORE the check for the escape_character.
  
          Note that if you change the window size of the parent the SIGWINCH
          signal will not be passed through to the child. If you want the child
          window size to change when the parent's window size changes then do
          something like the following example::
  
              import pexpect, struct, fcntl, termios, signal, sys
              def sigwinch_passthrough (sig, data):
                  s = struct.pack("HHHH", 0, 0, 0, 0)
                  a = struct.unpack('hhhh', fcntl.ioctl(sys.stdout.fileno(),
                      termios.TIOCGWINSZ , s))
                  if not p.closed:
                      p.setwinsize(a[0],a[1])
  
              # Note this 'p' is global and used in sigwinch_passthrough.
              p = pexpect.spawn('/bin/bash')
              signal.signal(signal.SIGWINCH, sigwinch_passthrough)
              p.interact()
docstring_summary: This gives control of the child process to the interactive user (the
          human at the keyboard). Keystrokes are sent to the child process, and
          the stdout and stderr output of the child process is printed. This
          simply echos the child stdout and child stderr to the real stdout and
          it echos the real stdin to the child stdin. When the user types the
          escape_character this method will return None. The escape_character
          will not be transmitted.  The default for escape_character is
          entered as ``Ctrl - ]``, the very same as BSD telnet. To prevent
          escaping, escape_character may be set to None.
docstring_tokens: This gives control of the child process to the interactive user ( the human at the keyboard ) . Keystrokes are sent to the child process and the stdout and stderr output of the child process is printed . This simply echos the child stdout and child stderr to the real stdout and it echos the real stdin to the child stdin . When the user types the escape_character this method will return None . The escape_character will not be transmitted . The default for escape_character is entered as Ctrl - ] the very same as BSD telnet . To prevent escaping escape_character may be set to None .
function: def interact(self, escape_character=chr(29),
              input_filter=None, output_filter=None):
  
          '''This gives control of the child process to the interactive user (the
          human at the keyboard). Keystrokes are sent to the child process, and
          the stdout and stderr output of the child process is printed. This
          simply echos the child stdout and child stderr to the real stdout and
          it echos the real stdin to the child stdin. When the user types the
          escape_character this method will return None. The escape_character
          will not be transmitted.  The default for escape_character is
          entered as ``Ctrl - ]``, the very same as BSD telnet. To prevent
          escaping, escape_character may be set to None.
  
          If a logfile is specified, then the data sent and received from the
          child process in interact mode is duplicated to the given log.
  
          You may pass in optional input and output filter functions. These
          functions should take bytes array and return bytes array too. Even
          with ``encoding='utf-8'`` support, meth:`interact` will always pass
          input_filter and output_filter bytes. You may need to wrap your
          function to decode and encode back to UTF-8.
  
          The output_filter will be passed all the output from the child process.
          The input_filter will be passed all the keyboard input from the user.
          The input_filter is run BEFORE the check for the escape_character.
  
          Note that if you change the window size of the parent the SIGWINCH
          signal will not be passed through to the child. If you want the child
          window size to change when the parent's window size changes then do
          something like the following example::
  
              import pexpect, struct, fcntl, termios, signal, sys
              def sigwinch_passthrough (sig, data):
                  s = struct.pack("HHHH", 0, 0, 0, 0)
                  a = struct.unpack('hhhh', fcntl.ioctl(sys.stdout.fileno(),
                      termios.TIOCGWINSZ , s))
                  if not p.closed:
                      p.setwinsize(a[0],a[1])
  
              # Note this 'p' is global and used in sigwinch_passthrough.
              p = pexpect.spawn('/bin/bash')
              signal.signal(signal.SIGWINCH, sigwinch_passthrough)
              p.interact()
          '''
  
          # Flush the buffer.
          self.write_to_stdout(self.buffer)
          self.stdout.flush()
          self._buffer = self.buffer_type()
          mode = tty.tcgetattr(self.STDIN_FILENO)
          tty.setraw(self.STDIN_FILENO)
          if escape_character is not None and PY3:
              escape_character = escape_character.encode('latin-1')
          try:
              self.__interact_copy(escape_character, input_filter, output_filter)
          finally:
              tty.tcsetattr(self.STDIN_FILENO, tty.TCSAFLUSH, mode)
function_tokens: def interact ( self , escape_character = chr ( 29 ) , input_filter = None , output_filter = None ) : # Flush the buffer. self . write_to_stdout ( self . buffer ) self . stdout . flush ( ) self . _buffer = self . buffer_type ( ) mode = tty . tcgetattr ( self . STDIN_FILENO ) tty . setraw ( self . STDIN_FILENO ) if escape_character is not None and PY3 : escape_character = escape_character . encode ( 'latin-1' ) try : self . __interact_copy ( escape_character , input_filter , output_filter ) finally : tty . tcsetattr ( self . STDIN_FILENO , tty . TCSAFLUSH , mode )