class_docstr: This is the main class interface for Pexpect. Use this class to start
  and control child applications. 
class_docstr_tok: ["This","is","the","main","class","interface","for","Pexpect",".","Use","this","class","to","start","and","control","child","applications","."]
docstr: Sends string ``s`` to the child process, returning the number of
  bytes written. If a logfile is specified, a copy is written to that
  log.
  
  The default terminal input mode is canonical processing unless set
  otherwise by the child process. This allows backspace and other line
  processing to be performed prior to transmitting to the receiving
  program. As this is buffered, there is a limited size of such buffer.
  
  On Linux systems, this is 4096 (defined by N_TTY_BUF_SIZE). All
  other systems honor the POSIX.1 definition PC_MAX_CANON -- 1024
  on OSX, 256 on OpenSolaris, and 1920 on FreeBSD.
  
  This value may be discovered using fpathconf(3)::
  
      >>> from os import fpathconf
      >>> print(fpathconf(0, 'PC_MAX_CANON'))
      256
  
  On such a system, only 256 bytes may be received per line. Any
  subsequent bytes received will be discarded. BEL (``''``) is then
  sent to output if IMAXBEL (termios.h) is set by the tty driver.
  This is usually enabled by default.  Linux does not honor this as
  an option -- it behaves as though it is always set on.
  
  Canonical input processing may be disabled altogether by executing
  a shell, then stty(1), before executing the final program::
  
      >>> bash = pexpect.spawn('/bin/bash', echo=False)
      >>> bash.sendline('stty -icanon')
      >>> bash.sendline('base64')
      >>> bash.sendline('x' * 5000)
docstr_tok: ["Sends","string","``","s","``","to","the","child","process",",","returning","the","number","of","bytes","written",".","If","a","logfile","is","specified",",","a","copy","is","written","to","that","log",".","The","default","terminal","input","mode","is","canonical","processing","unless","set","otherwise","by","the","child","process",".","This","allows","backspace","and","other","line","processing","to","be","performed","prior","to","transmitting","to","the","receiving","program",".","As","this","is","buffered",",","there","is","a","limited","size","of","such","buffer",".","On","Linux","systems",",","this","is","4096","(","defined","by","N_TTY_BUF_SIZE",")",".","All","other","systems","honor","the","POSIX.1","definition","PC_MAX_CANON","--","1024","on","OSX",",","256","on","OpenSolaris",",","and","1920","on","FreeBSD",".","This","value","may","be","discovered","using","fpathconf","(","3",")",":",":",">",">",">","from","os","import","fpathconf",">",">",">","print","(","fpathconf","(","0",",","'PC_MAX_CANON","'",")",")","256","On","such","a","system",",","only","256","bytes","may","be","received","per","line",".","Any","subsequent","bytes","received","will","be","discarded",".","BEL","(","``","'\u0007","'","``",")","is","then","sent","to","output","if","IMAXBEL","(","termios.h",")","is","set","by","the","tty","driver",".","This","is","usually","enabled","by","default",".","Linux","does","not","honor","this","as","an","option","--","it","behaves","as","though","it","is","always","set","on",".","Canonical","input","processing","may","be","disabled","altogether","by","executing","a","shell",",","then","stty","(","1",")",",","before","executing","the","final","program",":",":",">",">",">","bash","=","pexpect.spawn","(","'\/bin\/bash","'",",","echo=False",")",">",">",">","bash.sendline","(","'stty","-icanon","'",")",">",">",">","bash.sendline","(","'base64","'",")",">",">",">","bash.sendline","(","'","x","'","*","5000",")"]
code: def send(self, s):
      """Sends string ``s`` to the child process, returning the number of
      bytes written. If a logfile is specified, a copy is written to that
      log.
  
      The default terminal input mode is canonical processing unless set
      otherwise by the child process. This allows backspace and other line
      processing to be performed prior to transmitting to the receiving
      program. As this is buffered, there is a limited size of such buffer.
  
      On Linux systems, this is 4096 (defined by N_TTY_BUF_SIZE). All
      other systems honor the POSIX.1 definition PC_MAX_CANON -- 1024
      on OSX, 256 on OpenSolaris, and 1920 on FreeBSD.
  
      This value may be discovered using fpathconf(3)::
  
          >>> from os import fpathconf
          >>> print(fpathconf(0, 'PC_MAX_CANON'))
          256
  
      On such a system, only 256 bytes may be received per line. Any
      subsequent bytes received will be discarded. BEL (``'\a'``) is then
      sent to output if IMAXBEL (termios.h) is set by the tty driver.
      This is usually enabled by default.  Linux does not honor this as
      an option -- it behaves as though it is always set on.
  
      Canonical input processing may be disabled altogether by executing
      a shell, then stty(1), before executing the final program::
  
          >>> bash = pexpect.spawn('/bin/bash', echo=False)
          >>> bash.sendline('stty -icanon')
          >>> bash.sendline('base64')
          >>> bash.sendline('x' * 5000)
      """
  
      if self.delaybeforesend is not None:
          time.sleep(self.delaybeforesend)
  
      s = self._coerce_send_string(s)
      self._log(s, "send")
  
      b = self._encoder.encode(s, final=False)
      return os.write(self.child_fd, b)
  
imports: import os
  import sys
  import time
  import pty
  import tty
  import errno
  import signal
  from contextlib import contextmanager
  import ptyprocess
  from ptyprocess.ptyprocess import use_native_pty_fork
  from .exceptions import ExceptionPexpect, EOF, TIMEOUT
  from .spawnbase import SpawnBase
  from .utils import which, split_command_line, select_ignore_interrupts, poll_ignore_interrupts
label_desc: Use image node_id 13 for calling the spawn obj's underlying member method code with example usage: obj.send(s) and returns: os