MCPcopy Create free account
hub / github.com/pexpect/pexpect / send

Method send

pexpect/fdpexpect.py:100–106  ·  view source on GitHub ↗

Write to fd, return number of bytes written

(self, s)

Source from the content-addressed store, hash-verified

98 # documented as part of fdpexpect. You're encouraged to use os.write
99 # directly.
100 def send(self, s):
101 "Write to fd, return number of bytes written"
102 s = self._coerce_send_string(s)
103 self._log(s, 'send')
104
105 b = self._encoder.encode(s, final=False)
106 return os.write(self.child_fd, b)
107
108 def sendline(self, s):
109 "Write to fd with trailing newline, return number of bytes written"

Callers 2

sendlineMethod · 0.95
writeMethod · 0.95

Calls 4

_coerce_send_stringMethod · 0.80
_logMethod · 0.80
encodeMethod · 0.80
writeMethod · 0.45

Tested by

no test coverage detected