2 <!doctype html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
3 <html><head><title>Python: module fdpexpect</title>
4 </head><body bgcolor="#f0f0f8">
6 <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading">
8 <td valign=bottom> <br>
9 <font color="#ffffff" face="helvetica, arial"> <br><big><big><strong>fdpexpect</strong></big></big> (version 2.3)</font></td
10 ><td align=right valign=bottom
11 ><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="file:/home/noah/pexpect/trunk/pexpect/fdpexpect.py">/home/noah/pexpect/trunk/pexpect/fdpexpect.py</a></font></td></tr></table>
12 <p><tt>This is like pexpect, but will work on any file descriptor that you pass it.<br>
13 So you are reponsible for opening and close the file descriptor.<br>
15 $Id: fdpexpect.py 505 2007-12-26 21:33:50Z noah $</tt></p>
17 <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
18 <tr bgcolor="#aa55cc">
19 <td colspan=3 valign=bottom> <br>
20 <font color="#fffff" face="helvetica, arial"><big><strong>Modules</strong></big></font></td></tr>
22 <tr><td bgcolor="#aa55cc"><tt> </tt></td><td> </td>
23 <td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=top><a href="os.html">os</a><br>
24 </td><td width="25%" valign=top></td><td width="25%" valign=top></td><td width="25%" valign=top></td></tr></table></td></tr></table><p>
25 <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
26 <tr bgcolor="#ee77aa">
27 <td colspan=3 valign=bottom> <br>
28 <font color="#ffffff" face="helvetica, arial"><big><strong>Classes</strong></big></font></td></tr>
30 <tr><td bgcolor="#ee77aa"><tt> </tt></td><td> </td>
32 <dt><font face="helvetica, arial"><a href="pexpect.html#spawn">pexpect.spawn</a>(<a href="__builtin__.html#object">__builtin__.object</a>)
35 <dt><font face="helvetica, arial"><a href="fdpexpect.html#fdspawn">fdspawn</a>
40 <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
41 <tr bgcolor="#ffc8d8">
42 <td colspan=3 valign=bottom> <br>
43 <font color="#000000" face="helvetica, arial"><a name="fdspawn">class <strong>fdspawn</strong></a>(<a href="pexpect.html#spawn">pexpect.spawn</a>)</font></td></tr>
45 <tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td>
46 <td colspan=2><tt>This is like pexpect.<a href="pexpect.html#spawn">spawn</a> but allows you to supply your own open file<br>
47 descriptor. For example, you could use it to read through a file looking<br>
48 for patterns, or to control a modem or serial device.<br> </tt></td></tr>
50 <td width="100%"><dl><dt>Method resolution order:</dt>
51 <dd><a href="fdpexpect.html#fdspawn">fdspawn</a></dd>
52 <dd><a href="pexpect.html#spawn">pexpect.spawn</a></dd>
53 <dd><a href="__builtin__.html#object">__builtin__.object</a></dd>
56 Methods defined here:<br>
57 <dl><dt><a name="fdspawn-__del__"><strong>__del__</strong></a>(self)</dt></dl>
59 <dl><dt><a name="fdspawn-__init__"><strong>__init__</strong></a>(self, fd, args<font color="#909090">=[]</font>, timeout<font color="#909090">=30</font>, maxread<font color="#909090">=2000</font>, searchwindowsize<font color="#909090">=None</font>, logfile<font color="#909090">=None</font>)</dt><dd><tt>This takes a file descriptor (an int) or an object that support the<br>
60 <a href="#fdspawn-fileno">fileno</a>() method (returning an int). All Python file-like objects<br>
61 support <a href="#fdspawn-fileno">fileno</a>().</tt></dd></dl>
63 <dl><dt><a name="fdspawn-close"><strong>close</strong></a>(self)</dt></dl>
65 <dl><dt><a name="fdspawn-isalive"><strong>isalive</strong></a>(self)</dt><dd><tt>This checks if the file descriptor is still valid. If os.fstat()<br>
66 does not raise an exception then we assume it is alive.</tt></dd></dl>
68 <dl><dt><a name="fdspawn-kill"><strong>kill</strong></a>(self, sig)</dt></dl>
70 <dl><dt><a name="fdspawn-terminate"><strong>terminate</strong></a>(self, force<font color="#909090">=False</font>)</dt></dl>
73 Methods inherited from <a href="pexpect.html#spawn">pexpect.spawn</a>:<br>
74 <dl><dt><a name="fdspawn-__iter__"><strong>__iter__</strong></a>(self)</dt><dd><tt>This is to support iterators over a file-like object.</tt></dd></dl>
76 <dl><dt><a name="fdspawn-__str__"><strong>__str__</strong></a>(self)</dt><dd><tt>This returns a human-readable string that represents the state of<br>
77 the object.</tt></dd></dl>
79 <dl><dt><a name="fdspawn-compile_pattern_list"><strong>compile_pattern_list</strong></a>(self, patterns)</dt><dd><tt>This compiles a pattern-string or a list of pattern-strings.<br>
80 Patterns must be a StringType, EOF, TIMEOUT, SRE_Pattern, or a list of<br>
81 those. Patterns may also be None which results in an empty list (you<br>
82 might do this if waiting for an EOF or TIMEOUT condition without<br>
83 expecting any pattern).<br>
85 This is used by <a href="#fdspawn-expect">expect</a>() when calling <a href="#fdspawn-expect_list">expect_list</a>(). Thus <a href="#fdspawn-expect">expect</a>() is<br>
86 nothing more than::<br>
88 cpl = <a href="#fdspawn-compile_pattern_list">compile_pattern_list</a>(pl)<br>
89 return <a href="#fdspawn-expect_list">expect_list</a>(cpl, timeout)<br>
91 If you are using <a href="#fdspawn-expect">expect</a>() within a loop it may be more<br>
92 efficient to compile the patterns first and then call <a href="#fdspawn-expect_list">expect_list</a>().<br>
93 This avoid calls in a loop to <a href="#fdspawn-compile_pattern_list">compile_pattern_list</a>()::<br>
95 cpl = <a href="#fdspawn-compile_pattern_list">compile_pattern_list</a>(my_pattern)<br>
96 while some_condition:<br>
97 ...<br>
98 i = <a href="#fdspawn-expect_list">expect_list</a>(clp, timeout)<br>
99 ...</tt></dd></dl>
101 <dl><dt><a name="fdspawn-eof"><strong>eof</strong></a>(self)</dt><dd><tt>This returns True if the EOF exception was ever raised.</tt></dd></dl>
103 <dl><dt><a name="fdspawn-expect"><strong>expect</strong></a>(self, pattern, timeout<font color="#909090">=-1</font>, searchwindowsize<font color="#909090">=None</font>)</dt><dd><tt>This seeks through the stream until a pattern is matched. The<br>
104 pattern is overloaded and may take several types. The pattern can be a<br>
105 StringType, EOF, a compiled re, or a list of any of those types.<br>
106 Strings will be compiled to re types. This returns the index into the<br>
107 pattern list. If the pattern was not a list this returns index 0 on a<br>
108 successful match. This may raise exceptions for EOF or TIMEOUT. To<br>
109 avoid the EOF or TIMEOUT exceptions add EOF or TIMEOUT to the pattern<br>
110 list. That will cause expect to match an EOF or TIMEOUT condition<br>
111 instead of raising an exception.<br>
113 If you pass a list of patterns and more than one matches, the first match<br>
114 in the stream is chosen. If more than one pattern matches at that point,<br>
115 the leftmost in the pattern list is chosen. For example::<br>
117 # the input is 'foobar'<br>
118 index = p.expect (['bar', 'foo', 'foobar'])<br>
119 # returns 1 ('foo') even though 'foobar' is a "better" match<br>
121 Please note, however, that buffering can affect this behavior, since<br>
122 input arrives in unpredictable chunks. For example::<br>
124 # the input is 'foobar'<br>
125 index = p.expect (['foobar', 'foo'])<br>
126 # returns 0 ('foobar') if all input is available at once,<br>
127 # but returs 1 ('foo') if parts of the final 'bar' arrive late<br>
129 After a match is found the instance attributes 'before', 'after' and<br>
130 'match' will be set. You can see all the data read before the match in<br>
131 'before'. You can see the data that was matched in 'after'. The<br>
132 re.MatchObject used in the re match will be in 'match'. If an error<br>
133 occurred then 'before' will be set to all the data read so far and<br>
134 'after' and 'match' will be None.<br>
136 If timeout is -1 then timeout will be set to the self.<strong>timeout</strong> value.<br>
138 A list entry may be EOF or TIMEOUT instead of a string. This will<br>
139 catch these exceptions and return the index of the list entry instead<br>
140 of raising the exception. The attribute 'after' will be set to the<br>
141 exception type. The attribute 'match' will be None. This allows you to<br>
142 write code like this::<br>
144 index = p.expect (['good', 'bad', pexpect.EOF, pexpect.TIMEOUT])<br>
145 if index == 0:<br>
146 do_something()<br>
147 elif index == 1:<br>
148 do_something_else()<br>
149 elif index == 2:<br>
150 do_some_other_thing()<br>
151 elif index == 3:<br>
152 do_something_completely_different()<br>
154 instead of code like this::<br>
156 try:<br>
157 index = p.expect (['good', 'bad'])<br>
158 if index == 0:<br>
159 do_something()<br>
160 elif index == 1:<br>
161 do_something_else()<br>
162 except EOF:<br>
163 do_some_other_thing()<br>
164 except TIMEOUT:<br>
165 do_something_completely_different()<br>
167 These two forms are equivalent. It all depends on what you want. You<br>
168 can also just expect the EOF if you are waiting for all output of a<br>
169 child to finish. For example::<br>
171 p = pexpect.<a href="pexpect.html#spawn">spawn</a>('/bin/ls')<br>
172 p.expect (pexpect.EOF)<br>
173 print p.before<br>
175 If you are trying to optimize for speed then see <a href="#fdspawn-expect_list">expect_list</a>().</tt></dd></dl>
177 <dl><dt><a name="fdspawn-expect_exact"><strong>expect_exact</strong></a>(self, pattern_list, timeout<font color="#909090">=-1</font>, searchwindowsize<font color="#909090">=-1</font>)</dt><dd><tt>This is similar to <a href="#fdspawn-expect">expect</a>(), but uses plain string matching instead<br>
178 of compiled regular expressions in 'pattern_list'. The 'pattern_list'<br>
179 may be a string; a list or other sequence of strings; or TIMEOUT and<br>
182 This call might be faster than <a href="#fdspawn-expect">expect</a>() for two reasons: string<br>
183 searching is faster than RE matching and it is possible to limit the<br>
184 search to just the end of the input buffer.<br>
186 This method is also useful when you don't want to have to worry about<br>
187 escaping regular expression characters that you want to match.</tt></dd></dl>
189 <dl><dt><a name="fdspawn-expect_list"><strong>expect_list</strong></a>(self, pattern_list, timeout<font color="#909090">=-1</font>, searchwindowsize<font color="#909090">=-1</font>)</dt><dd><tt>This takes a list of compiled regular expressions and returns the<br>
190 index into the pattern_list that matched the child output. The list may<br>
191 also contain EOF or TIMEOUT (which are not compiled regular<br>
192 expressions). This method is similar to the <a href="#fdspawn-expect">expect</a>() method except that<br>
193 <a href="#fdspawn-expect_list">expect_list</a>() does not recompile the pattern list on every call. This<br>
194 may help if you are trying to optimize for speed, otherwise just use<br>
195 the <a href="#fdspawn-expect">expect</a>() method. This is called by <a href="#fdspawn-expect">expect</a>(). If timeout==-1 then<br>
196 the self.<strong>timeout</strong> value is used. If searchwindowsize==-1 then the<br>
197 self.<strong>searchwindowsize</strong> value is used.</tt></dd></dl>
199 <dl><dt><a name="fdspawn-expect_loop"><strong>expect_loop</strong></a>(self, searcher, timeout<font color="#909090">=-1</font>, searchwindowsize<font color="#909090">=-1</font>)</dt><dd><tt>This is the common loop used inside expect. The 'searcher' should be<br>
200 an instance of searcher_re or searcher_string, which describes how and what<br>
201 to search for in the input.<br>
203 See <a href="#fdspawn-expect">expect</a>() for other arguments, return value and exceptions.</tt></dd></dl>
205 <dl><dt><a name="fdspawn-fileno"><strong>fileno</strong></a>(self)</dt><dd><tt>This returns the file descriptor of the pty for the child.</tt></dd></dl>
207 <dl><dt><a name="fdspawn-flush"><strong>flush</strong></a>(self)</dt><dd><tt>This does nothing. It is here to support the interface for a<br>
208 File-like object.</tt></dd></dl>
210 <dl><dt><a name="fdspawn-getecho"><strong>getecho</strong></a>(self)</dt><dd><tt>This returns the terminal echo mode. This returns True if echo is<br>
211 on or False if echo is off. Child applications that are expecting you<br>
212 to enter a password often set ECHO False. See <a href="#fdspawn-waitnoecho">waitnoecho</a>().</tt></dd></dl>
214 <dl><dt><a name="fdspawn-getwinsize"><strong>getwinsize</strong></a>(self)</dt><dd><tt>This returns the terminal window size of the child tty. The return<br>
215 value is a tuple of (rows, cols).</tt></dd></dl>
217 <dl><dt><a name="fdspawn-interact"><strong>interact</strong></a>(self, escape_character<font color="#909090">='<font color="#c040c0">\x1d</font>'</font>, input_filter<font color="#909090">=None</font>, output_filter<font color="#909090">=None</font>)</dt><dd><tt>This gives control of the child process to the interactive user (the<br>
218 human at the keyboard). Keystrokes are sent to the child process, and<br>
219 the stdout and stderr output of the child process is printed. This<br>
220 simply echos the child stdout and child stderr to the real stdout and<br>
221 it echos the real stdin to the child stdin. When the user types the<br>
222 escape_character this method will stop. The default for<br>
223 escape_character is ^]. This should not be confused with ASCII 27 --<br>
224 the ESC character. ASCII 29 was chosen for historical merit because<br>
225 this is the character used by 'telnet' as the escape character. The<br>
226 escape_character will not be sent to the child process.<br>
228 You may pass in optional input and output filter functions. These<br>
229 functions should take a string and return a string. The output_filter<br>
230 will be passed all the output from the child process. The input_filter<br>
231 will be passed all the keyboard input from the user. The input_filter<br>
232 is run BEFORE the check for the escape_character.<br>
234 Note that if you change the window size of the parent the SIGWINCH<br>
235 signal will not be passed through to the child. If you want the child<br>
236 window size to change when the parent's window size changes then do<br>
237 something like the following example::<br>
239 import pexpect, struct, fcntl, termios, signal, sys<br>
240 def sigwinch_passthrough (sig, data):<br>
241 s = struct.pack("HHHH", 0, 0, 0, 0)<br>
242 a = struct.unpack('hhhh', fcntl.ioctl(sys.stdout.<a href="#fdspawn-fileno">fileno</a>(), termios.TIOCGWINSZ , s))<br>
243 global p<br>
244 p.<a href="#fdspawn-setwinsize">setwinsize</a>(a[0],a[1])<br>
245 p = pexpect.<a href="pexpect.html#spawn">spawn</a>('/bin/bash') # Note this is global and used in sigwinch_passthrough.<br>
246 signal.signal(signal.SIGWINCH, sigwinch_passthrough)<br>
247 p.<a href="#fdspawn-interact">interact</a>()</tt></dd></dl>
249 <dl><dt><a name="fdspawn-isatty"><strong>isatty</strong></a>(self)</dt><dd><tt>This returns True if the file descriptor is open and connected to a<br>
250 tty(-like) device, else False.</tt></dd></dl>
252 <dl><dt><a name="fdspawn-next"><strong>next</strong></a>(self)</dt><dd><tt>This is to support iterators over a file-like object.</tt></dd></dl>
254 <dl><dt><a name="fdspawn-read"><strong>read</strong></a>(self, size<font color="#909090">=-1</font>)</dt><dd><tt>This reads at most "size" bytes from the file (less if the read hits<br>
255 EOF before obtaining size bytes). If the size argument is negative or<br>
256 omitted, read all data until EOF is reached. The bytes are returned as<br>
257 a string object. An empty string is returned when EOF is encountered<br>
258 immediately.</tt></dd></dl>
260 <dl><dt><a name="fdspawn-read_nonblocking"><strong>read_nonblocking</strong></a>(self, size<font color="#909090">=1</font>, timeout<font color="#909090">=-1</font>)</dt><dd><tt>This reads at most size characters from the child application. It<br>
261 includes a timeout. If the read does not complete within the timeout<br>
262 period then a TIMEOUT exception is raised. If the end of file is read<br>
263 then an EOF exception will be raised. If a log file was set using<br>
264 <a href="#fdspawn-setlog">setlog</a>() then all data will also be written to the log file.<br>
266 If timeout is None then the read may block indefinitely. If timeout is -1<br>
267 then the self.<strong>timeout</strong> value is used. If timeout is 0 then the child is<br>
268 polled and if there was no data immediately ready then this will raise<br>
269 a TIMEOUT exception.<br>
271 The timeout refers only to the amount of time to read at least one<br>
272 character. This is not effected by the 'size' parameter, so if you call<br>
273 <a href="#fdspawn-read_nonblocking">read_nonblocking</a>(size=100, timeout=30) and only one character is<br>
274 available right away then one character will be returned immediately.<br>
275 It will not wait for 30 seconds for another 99 characters to come in.<br>
277 This is a wrapper around os.<a href="#fdspawn-read">read</a>(). It uses select.select() to<br>
278 implement the timeout.</tt></dd></dl>
280 <dl><dt><a name="fdspawn-readline"><strong>readline</strong></a>(self, size<font color="#909090">=-1</font>)</dt><dd><tt>This reads and returns one entire line. A trailing newline is kept<br>
281 in the string, but may be absent when a file ends with an incomplete<br>
282 line. Note: This <a href="#fdspawn-readline">readline</a>() looks for a \r\n pair even on UNIX<br>
283 because this is what the pseudo tty device returns. So contrary to what<br>
284 you may expect you will receive the newline as \r\n. An empty string<br>
285 is returned when EOF is hit immediately. Currently, the size argument is<br>
286 mostly ignored, so this behavior is not standard for a file-like<br>
287 object. If size is 0 then an empty string is returned.</tt></dd></dl>
289 <dl><dt><a name="fdspawn-readlines"><strong>readlines</strong></a>(self, sizehint<font color="#909090">=-1</font>)</dt><dd><tt>This reads until EOF using <a href="#fdspawn-readline">readline</a>() and returns a list containing<br>
290 the lines thus read. The optional "sizehint" argument is ignored.</tt></dd></dl>
292 <dl><dt><a name="fdspawn-send"><strong>send</strong></a>(self, s)</dt><dd><tt>This sends a string to the child process. This returns the number of<br>
293 bytes written. If a log file was set then the data is also written to<br>
294 the log.</tt></dd></dl>
296 <dl><dt><a name="fdspawn-sendcontrol"><strong>sendcontrol</strong></a>(self, char)</dt><dd><tt>This sends a control character to the child such as Ctrl-C or<br>
297 Ctrl-D. For example, to send a Ctrl-G (ASCII 7)::<br>
299 child.<a href="#fdspawn-sendcontrol">sendcontrol</a>('g')<br>
301 See also, <a href="#fdspawn-sendintr">sendintr</a>() and <a href="#fdspawn-sendeof">sendeof</a>().</tt></dd></dl>
303 <dl><dt><a name="fdspawn-sendeof"><strong>sendeof</strong></a>(self)</dt><dd><tt>This sends an EOF to the child. This sends a character which causes<br>
304 the pending parent output buffer to be sent to the waiting child<br>
305 program without waiting for end-of-line. If it is the first character<br>
306 of the line, the <a href="#fdspawn-read">read</a>() in the user program returns 0, which signifies<br>
307 end-of-file. This means to work as expected a <a href="#fdspawn-sendeof">sendeof</a>() has to be<br>
308 called at the beginning of a line. This method does not send a newline.<br>
309 It is the responsibility of the caller to ensure the eof is sent at the<br>
310 beginning of a line.</tt></dd></dl>
312 <dl><dt><a name="fdspawn-sendintr"><strong>sendintr</strong></a>(self)</dt><dd><tt>This sends a SIGINT to the child. It does not require<br>
313 the SIGINT to be the first character on a line.</tt></dd></dl>
315 <dl><dt><a name="fdspawn-sendline"><strong>sendline</strong></a>(self, s<font color="#909090">=''</font>)</dt><dd><tt>This is like <a href="#fdspawn-send">send</a>(), but it adds a line feed (os.linesep). This<br>
316 returns the number of bytes written.</tt></dd></dl>
318 <dl><dt><a name="fdspawn-setecho"><strong>setecho</strong></a>(self, state)</dt><dd><tt>This sets the terminal echo mode on or off. Note that anything the<br>
319 child sent before the echo will be lost, so you should be sure that<br>
320 your input buffer is empty before you call <a href="#fdspawn-setecho">setecho</a>(). For example, the<br>
321 following will work as expected::<br>
323 p = pexpect.<a href="pexpect.html#spawn">spawn</a>('cat')<br>
324 p.sendline ('1234') # We will see this twice (once from tty echo and again from cat).<br>
325 p.expect (['1234'])<br>
326 p.expect (['1234'])<br>
327 p.<a href="#fdspawn-setecho">setecho</a>(False) # Turn off tty echo<br>
328 p.sendline ('abcd') # We will set this only once (echoed by cat).<br>
329 p.sendline ('wxyz') # We will set this only once (echoed by cat)<br>
330 p.expect (['abcd'])<br>
331 p.expect (['wxyz'])<br>
333 The following WILL NOT WORK because the lines sent before the setecho<br>
334 will be lost::<br>
336 p = pexpect.<a href="pexpect.html#spawn">spawn</a>('cat')<br>
337 p.sendline ('1234') # We will see this twice (once from tty echo and again from cat).<br>
338 p.<a href="#fdspawn-setecho">setecho</a>(False) # Turn off tty echo<br>
339 p.sendline ('abcd') # We will set this only once (echoed by cat).<br>
340 p.sendline ('wxyz') # We will set this only once (echoed by cat)<br>
341 p.expect (['1234'])<br>
342 p.expect (['1234'])<br>
343 p.expect (['abcd'])<br>
344 p.expect (['wxyz'])</tt></dd></dl>
346 <dl><dt><a name="fdspawn-setlog"><strong>setlog</strong></a>(self, fileobject)</dt><dd><tt>This method is no longer supported or allowed.</tt></dd></dl>
348 <dl><dt><a name="fdspawn-setmaxread"><strong>setmaxread</strong></a>(self, maxread)</dt><dd><tt>This method is no longer supported or allowed. I don't like getters<br>
349 and setters without a good reason.</tt></dd></dl>
351 <dl><dt><a name="fdspawn-setwinsize"><strong>setwinsize</strong></a>(self, r, c)</dt><dd><tt>This sets the terminal window size of the child tty. This will cause<br>
352 a SIGWINCH signal to be sent to the child. This does not change the<br>
353 physical window size. It changes the size reported to TTY-aware<br>
354 applications like vi or curses -- applications that respond to the<br>
355 SIGWINCH signal.</tt></dd></dl>
357 <dl><dt><a name="fdspawn-wait"><strong>wait</strong></a>(self)</dt><dd><tt>This waits until the child exits. This is a blocking call. This will<br>
358 not read any data from the child, so this will block forever if the<br>
359 child has unread output and has terminated. In other words, the child<br>
360 may have printed output then called exit(); but, technically, the child<br>
361 is still alive until its output is read.</tt></dd></dl>
363 <dl><dt><a name="fdspawn-waitnoecho"><strong>waitnoecho</strong></a>(self, timeout<font color="#909090">=-1</font>)</dt><dd><tt>This waits until the terminal ECHO flag is set False. This returns<br>
364 True if the echo mode is off. This returns False if the ECHO flag was<br>
365 not set False before the timeout. This can be used to detect when the<br>
366 child is waiting for a password. Usually a child application will turn<br>
367 off echo mode when it is waiting for the user to enter a password. For<br>
368 example, instead of expecting the "password:" prompt you can wait for<br>
369 the child to set ECHO off::<br>
371 p = pexpect.<a href="pexpect.html#spawn">spawn</a> ('ssh
[email protected]')<br>
372 p.<a href="#fdspawn-waitnoecho">waitnoecho</a>()<br>
373 p.<a href="#fdspawn-sendline">sendline</a>(mypassword)<br>
375 If timeout is None then this method to block forever until ECHO flag is<br>
376 False.</tt></dd></dl>
378 <dl><dt><a name="fdspawn-write"><strong>write</strong></a>(self, s)</dt><dd><tt>This is similar to <a href="#fdspawn-send">send</a>() except that there is no return value.</tt></dd></dl>
380 <dl><dt><a name="fdspawn-writelines"><strong>writelines</strong></a>(self, sequence)</dt><dd><tt>This calls <a href="#fdspawn-write">write</a>() for each element in the sequence. The sequence<br>
381 can be any iterable object producing strings, typically a list of<br>
382 strings. This does not add line separators There is no return value.</tt></dd></dl>
385 Data descriptors inherited from <a href="pexpect.html#spawn">pexpect.spawn</a>:<br>
386 <dl><dt><strong>__dict__</strong></dt>
387 <dd><tt>dictionary for instance variables (if defined)</tt></dd>
389 <dl><dt><strong>__weakref__</strong></dt>
390 <dd><tt>list of weak references to the object (if defined)</tt></dd>
392 </td></tr></table></td></tr></table><p>
393 <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
394 <tr bgcolor="#55aa55">
395 <td colspan=3 valign=bottom> <br>
396 <font color="#ffffff" face="helvetica, arial"><big><strong>Data</strong></big></font></td></tr>
398 <tr><td bgcolor="#55aa55"><tt> </tt></td><td> </td>
399 <td width="100%"><strong>__all__</strong> = ['fdspawn']<br>
400 <strong>__revision__</strong> = '$Revision: 399 $'<br>
401 <strong>__version__</strong> = '2.3'</td></tr></table>