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: This sets the terminal echo mode on or off. Note that anything the
  child sent before the echo will be lost, so you should be sure that
  your input buffer is empty before you call setecho(). For example, the
  following will work as expected::
  
      p = pexpect.spawn('cat') # Echo is on by default.
      p.sendline('1234') # We expect see this twice from the child...
      p.expect(['1234']) # ... once from the tty echo...
      p.expect(['1234']) # ... and again from cat itself.
      p.setecho(False) # Turn off tty echo
      p.sendline('abcd') # We will set this only once (echoed by cat).
      p.sendline('wxyz') # We will set this only once (echoed by cat)
      p.expect(['abcd'])
      p.expect(['wxyz'])
  
  The following WILL NOT WORK because the lines sent before the setecho
  will be lost::
  
      p = pexpect.spawn('cat')
      p.sendline('1234')
      p.setecho(False) # Turn off tty echo
      p.sendline('abcd') # We will set this only once (echoed by cat).
      p.sendline('wxyz') # We will set this only once (echoed by cat)
      p.expect(['1234'])
      p.expect(['1234'])
      p.expect(['abcd'])
      p.expect(['wxyz'])
  
  
  Not supported on platforms where ``isatty()`` returns False.
docstr_tok: ["This","sets","the","terminal","echo","mode","on","or","off",".","Note","that","anything","the","child","sent","before","the","echo","will","be","lost",",","so","you","should","be","sure","that","your","input","buffer","is","empty","before","you","call","setecho","(",")",".","For","example",",","the","following","will","work","as","expected",":",":","p","=","pexpect.spawn","(","'cat","'",")","#","Echo","is","on","by","default",".","p.sendline","(","'1234","'",")","#","We","expect","see","this","twice","from","the","child","...","p.expect","(","[","'1234","'","]",")","#","...","once","from","the","tty","echo","...","p.expect","(","[","'1234","'","]",")","#","...","and","again","from","cat","itself",".","p.setecho","(","False",")","#","Turn","off","tty","echo","p.sendline","(","'abcd","'",")","#","We","will","set","this","only","once","(","echoed","by","cat",")",".","p.sendline","(","'wxyz","'",")","#","We","will","set","this","only","once","(","echoed","by","cat",")","p.expect","(","[","'abcd","'","]",")","p.expect","(","[","'wxyz","'","]",")","The","following","WILL","NOT","WORK","because","the","lines","sent","before","the","setecho","will","be","lost",":",":","p","=","pexpect.spawn","(","'cat","'",")","p.sendline","(","'1234","'",")","p.setecho","(","False",")","#","Turn","off","tty","echo","p.sendline","(","'abcd","'",")","#","We","will","set","this","only","once","(","echoed","by","cat",")",".","p.sendline","(","'wxyz","'",")","#","We","will","set","this","only","once","(","echoed","by","cat",")","p.expect","(","[","'1234","'","]",")","p.expect","(","[","'1234","'","]",")","p.expect","(","[","'abcd","'","]",")","p.expect","(","[","'wxyz","'","]",")","Not","supported","on","platforms","where","``","isatty","(",")","``","returns","False","."]
code: def setecho(self, state):
      """This sets the terminal echo mode on or off. Note that anything the
      child sent before the echo will be lost, so you should be sure that
      your input buffer is empty before you call setecho(). For example, the
      following will work as expected::
  
          p = pexpect.spawn('cat') # Echo is on by default.
          p.sendline('1234') # We expect see this twice from the child...
          p.expect(['1234']) # ... once from the tty echo...
          p.expect(['1234']) # ... and again from cat itself.
          p.setecho(False) # Turn off tty echo
          p.sendline('abcd') # We will set this only once (echoed by cat).
          p.sendline('wxyz') # We will set this only once (echoed by cat)
          p.expect(['abcd'])
          p.expect(['wxyz'])
  
      The following WILL NOT WORK because the lines sent before the setecho
      will be lost::
  
          p = pexpect.spawn('cat')
          p.sendline('1234')
          p.setecho(False) # Turn off tty echo
          p.sendline('abcd') # We will set this only once (echoed by cat).
          p.sendline('wxyz') # We will set this only once (echoed by cat)
          p.expect(['1234'])
          p.expect(['1234'])
          p.expect(['abcd'])
          p.expect(['wxyz'])
  
  
      Not supported on platforms where ``isatty()`` returns False.
      """
      return self.ptyproc.setecho(state)
  
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 9 for calling the spawn obj's underlying member method code with example usage: obj.setecho(state) and returns: self