class_docstr: This class represents a process running in a pseudoterminal.
  
  The main constructor is the :meth:`spawn` classmethod.
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.
      """
      _setecho(self.fd, state)
  
      self.echo = state
  
imports: import codecs
  import errno
  import fcntl
  import io
  import os
  import pty
  import resource
  import signal
  import struct
  import sys
  import termios
  import time
  from pty import STDIN_FILENO, CHILD
  from .util import which, PtyProcessError
label_desc: Use image node_id 13 for calling the PtyProcess obj's underlying member method code with example usage: obj.setecho(state) without return types