1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377
|
<!doctype html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><title>Python: module pxssh</title>
</head><body bgcolor="#f0f0f8">
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading">
<tr bgcolor="#7799ee">
<td valign=bottom> <br>
<font color="#ffffff" face="helvetica, arial"> <br><big><big><strong>pxssh</strong></big></big> (version 2.1)</font></td
><td align=right valign=bottom
><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="file:/home/noah/documents/export/engineering/source/python/pexpect/trunk/pexpect/pxssh.py">/home/noah/documents/export/engineering/source/python/pexpect/trunk/pexpect/pxssh.py</a></font></td></tr></table>
<p></p>
<p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ee77aa">
<td colspan=3 valign=bottom> <br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Classes</strong></big></font></td></tr>
<tr><td bgcolor="#ee77aa"><tt> </tt></td><td> </td>
<td width="100%"><dl>
<dt><font face="helvetica, arial"><a href="pexpect.html#spawn">pexpect.spawn</a>(<a href="__builtin__.html#object">__builtin__.object</a>)
</font></dt><dd>
<dl>
<dt><font face="helvetica, arial"><a href="pxssh.html#pxssh">pxssh</a>
</font></dt></dl>
</dd>
</dl>
<p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom> <br>
<font color="#000000" face="helvetica, arial"><a name="pxssh">class <strong>pxssh</strong></a>(<a href="pexpect.html#spawn">pexpect.spawn</a>)</font></td></tr>
<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td>
<td colspan=2><tt>This class extends pexpect.<a href="pexpect.html#spawn">spawn</a> to specialize setting up SSH connections.<br>
This adds methods for login, logout, and expecting the prompt.<br>
It does various hacky things to handle any situation in the SSH login process.<br>
For example, if the session is your first login, then it automatically<br>
accepts the certificate; or if you have public key authentication setup<br>
and you don't need a password then this is OK too.<br>
<br>
Example usage that runs 'ls -l' on server and prints the result:<br>
import <a href="#pxssh">pxssh</a><br>
s = <a href="#pxssh">pxssh</a>.<a href="#pxssh">pxssh</a>()<br>
if not s.login ('localhost', 'myusername', 'mypassword'):<br>
print "SSH session failed on login."<br>
print str(s)<br>
else:<br>
print "SSH session login successful"<br>
s.sendline ('ls -l')<br>
s.<a href="#pxssh-prompt">prompt</a>() # match the prompt<br>
print s.before # print everything before the prompt.<br>
s.<a href="#pxssh-logout">logout</a>()<br> </tt></td></tr>
<tr><td> </td>
<td width="100%"><dl><dt>Method resolution order:</dt>
<dd><a href="pxssh.html#pxssh">pxssh</a></dd>
<dd><a href="pexpect.html#spawn">pexpect.spawn</a></dd>
<dd><a href="__builtin__.html#object">__builtin__.object</a></dd>
</dl>
<hr>
Methods defined here:<br>
<dl><dt><a name="pxssh-__init__"><strong>__init__</strong></a>(self)</dt></dl>
<dl><dt><a name="pxssh-login"><strong>login</strong></a>(self, server, username, password<font color="#909090">=''</font>, terminal_type<font color="#909090">='ansi'</font>, original_prompts<font color="#909090">='][#$]|~[#$]|bash.*?[#$]|[#$] '</font>, login_timeout<font color="#909090">=10</font>)</dt><dd><tt>This logs the user into the given server. By default the prompt is<br>
rather optimistic and should be considered more of an example. It's<br>
better to try to match the prompt as exactly as possible to prevent<br>
any false matches by server strings such as a "Message Of The Day" or<br>
something. The closer you can make the original_prompt match your real prompt<br>
then the better. A timeout will not necessarily cause the login to fail.<br>
In the case of a timeout we assume that the prompt was so weird that<br>
we could not match it. We still try to reset the prompt to something<br>
more unique. If that still fails then we return False.</tt></dd></dl>
<dl><dt><a name="pxssh-logout"><strong>logout</strong></a>(self)</dt><dd><tt>This sends exit. If there are stopped jobs then this sends exit twice.</tt></dd></dl>
<dl><dt><a name="pxssh-prompt"><strong>prompt</strong></a>(self, timeout<font color="#909090">=20</font>)</dt><dd><tt>This expects the prompt. This returns True if the prompt was matched.<br>
This returns False if there was a timeout.</tt></dd></dl>
<dl><dt><a name="pxssh-set_unique_prompt"><strong>set_unique_prompt</strong></a>(self, optional_prompt<font color="#909090">=None</font>)</dt><dd><tt>This attempts to reset the shell prompt to something more unique.<br>
This makes it easier to match unambiguously.</tt></dd></dl>
<hr>
Methods inherited from <a href="pexpect.html#spawn">pexpect.spawn</a>:<br>
<dl><dt><a name="pxssh-__del__"><strong>__del__</strong></a>(self)</dt><dd><tt>This makes sure that no system resources are left open.<br>
Python only garbage collects Python objects. OS file descriptors<br>
are not Python objects, so they must be handled explicitly.<br>
If the child file descriptor was opened outside of this class<br>
(passed to the constructor) then this does not close it.</tt></dd></dl>
<dl><dt><a name="pxssh-__iter__"><strong>__iter__</strong></a>(self)</dt><dd><tt>This is to support iterators over a file-like object.</tt></dd></dl>
<dl><dt><a name="pxssh-__str__"><strong>__str__</strong></a>(self)</dt><dd><tt>This returns the current state of the pexpect object as a string.</tt></dd></dl>
<dl><dt><a name="pxssh-close"><strong>close</strong></a>(self, force<font color="#909090">=True</font>)</dt><dd><tt>This closes the connection with the child application.<br>
Note that calling <a href="#pxssh-close">close</a>() more than once is valid.<br>
This emulates standard Python behavior with files.<br>
Set force to True if you want to make sure that the child is terminated<br>
(SIGKILL is sent if the child ignores SIGHUP and SIGINT).</tt></dd></dl>
<dl><dt><a name="pxssh-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>
Patterns must be a StringType, EOF, TIMEOUT, SRE_Pattern, or <br>
a list of those. Patterns may also be None which results in<br>
an empty list.<br>
<br>
This is used by <a href="#pxssh-expect">expect</a>() when calling <a href="#pxssh-expect_list">expect_list</a>().<br>
Thus <a href="#pxssh-expect">expect</a>() is nothing more than::<br>
cpl = <a href="#pxssh-compile_pattern_list">compile_pattern_list</a>(pl)<br>
return <a href="#pxssh-expect_list">expect_list</a>(clp, timeout)<br>
<br>
If you are using <a href="#pxssh-expect">expect</a>() within a loop it may be more<br>
efficient to compile the patterns first and then call <a href="#pxssh-expect_list">expect_list</a>().<br>
This avoid calls in a loop to <a href="#pxssh-compile_pattern_list">compile_pattern_list</a>():<br>
cpl = <a href="#pxssh-compile_pattern_list">compile_pattern_list</a>(my_pattern)<br>
while some_condition:<br>
...<br>
i = <a href="#pxssh-expect_list">expect_list</a>(clp, timeout)<br>
...</tt></dd></dl>
<dl><dt><a name="pxssh-eof"><strong>eof</strong></a>(self)</dt><dd><tt>This returns True if the EOF exception was ever raised.</tt></dd></dl>
<dl><dt><a name="pxssh-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.<br>
The pattern is overloaded and may take several types including a list.<br>
The pattern can be a StringType, EOF, a compiled re, or a list of<br>
those types. Strings will be compiled to re types. This returns the<br>
index into the pattern list. If the pattern was not a list this<br>
returns index 0 on a successful match. This may raise exceptions for<br>
EOF or TIMEOUT. To avoid the EOF or TIMEOUT exceptions add<br>
EOF or TIMEOUT to the pattern list.<br>
<br>
After a match is found the instance attributes<br>
'before', 'after' and 'match' will be set.<br>
You can see all the data read before the match in 'before'.<br>
You can see the data that was matched in 'after'.<br>
The re.MatchObject used in the re match will be in 'match'.<br>
If an error occured then 'before' will be set to all the<br>
data read so far and 'after' and 'match' will be None.<br>
<br>
If timeout is -1 then timeout will be set to the self.<strong>timeout</strong> value.<br>
<br>
Note: A list entry may be EOF or TIMEOUT instead of a string.<br>
This will catch these exceptions and return the index<br>
of the list entry instead of raising the exception.<br>
The attribute 'after' will be set to the exception type.<br>
The attribute 'match' will be None.<br>
This allows you to write code like this:<br>
index = p.expect (['good', 'bad', pexpect.EOF, pexpect.TIMEOUT])<br>
if index == 0:<br>
do_something()<br>
elif index == 1:<br>
do_something_else()<br>
elif index == 2:<br>
do_some_other_thing()<br>
elif index == 3:<br>
do_something_completely_different()<br>
instead of code like this:<br>
try:<br>
index = p.expect (['good', 'bad'])<br>
if index == 0:<br>
do_something()<br>
elif index == 1:<br>
do_something_else()<br>
except EOF:<br>
do_some_other_thing()<br>
except TIMEOUT:<br>
do_something_completely_different()<br>
These two forms are equivalent. It all depends on what you want.<br>
You can also just expect the EOF if you are waiting for all output<br>
of a child to finish. For example:<br>
p = pexpect.<a href="pexpect.html#spawn">spawn</a>('/bin/ls')<br>
p.expect (pexpect.EOF)<br>
print p.before<br>
<br>
If you are trying to optimize for speed then see <a href="#pxssh-expect_list">expect_list</a>().</tt></dd></dl>
<dl><dt><a name="pxssh-expect_exact"><strong>expect_exact</strong></a>(self, pattern_list, timeout<font color="#909090">=-1</font>)</dt><dd><tt>This method is no longer supported or allowed.<br>
It was too hard to maintain and keep it up to date with expect_list.<br>
Few people used this method. Most people favored reliability over speed.<br>
The implementation is left in comments in case anyone needs to hack this<br>
feature back into their copy.<br>
If someone wants to diff this with expect_list and make them work<br>
nearly the same then I will consider adding this make in.</tt></dd></dl>
<dl><dt><a name="pxssh-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 <br>
the index into the pattern_list that matched the child output.<br>
The list may also contain EOF or TIMEOUT (which are not<br>
compiled regular expressions). This method is similar to<br>
the <a href="#pxssh-expect">expect</a>() method except that <a href="#pxssh-expect_list">expect_list</a>() does not<br>
recompile the pattern list on every call.<br>
This may help if you are trying to optimize for speed, otherwise<br>
just use the <a href="#pxssh-expect">expect</a>() method. This is called by <a href="#pxssh-expect">expect</a>().<br>
If timeout==-1 then the self.<strong>timeout</strong> value is used.<br>
If searchwindowsize==-1 then the self.<strong>searchwindowsize</strong> value is used.</tt></dd></dl>
<dl><dt><a name="pxssh-fileno"><strong>fileno</strong></a>(self)</dt><dd><tt>This returns the file descriptor of the pty for the child.</tt></dd></dl>
<dl><dt><a name="pxssh-flush"><strong>flush</strong></a>(self)</dt><dd><tt>This does nothing. It is here to support the interface for a File-like object.</tt></dd></dl>
<dl><dt><a name="pxssh-getwinsize"><strong>getwinsize</strong></a>(self)</dt><dd><tt>This returns the terminal window size of the child tty.<br>
The return value is a tuple of (rows, cols).</tt></dd></dl>
<dl><dt><a name="pxssh-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<br>
(the human at the keyboard).<br>
Keystrokes are sent to the child process, and the stdout and stderr<br>
output of the child process is printed.<br>
This simply echos the child stdout and child stderr to the real<br>
stdout and it echos the real stdin to the child stdin.<br>
When the user types the escape_character this method will stop.<br>
The default for escape_character is ^]. This should not be confused<br>
with ASCII 27 -- the ESC character. ASCII 29 was chosen<br>
for historical merit because this is the character used<br>
by 'telnet' as the escape character. The escape_character will<br>
not be sent to the child process.<br>
<br>
You may pass in optional input and output filter functions.<br>
These functions should take a string and return a string.<br>
The output_filter will be passed all the output from the child process.<br>
The input_filter will be passed all the keyboard input from the user.<br>
The input_filter is run BEFORE the check for the escape_character.<br>
<br>
Note that if you change the window size of the parent<br>
the SIGWINCH signal will not be passed through to the child.<br>
If you want the child window size to change when the parent's<br>
window size changes then do something like the following example:<br>
import pexpect, struct, fcntl, termios, signal, sys<br>
def sigwinch_passthrough (sig, data):<br>
s = struct.pack("HHHH", 0, 0, 0, 0)<br>
a = struct.unpack('hhhh', fcntl.ioctl(sys.stdout.<a href="#pxssh-fileno">fileno</a>(), termios.TIOCGWINSZ , s))<br>
global p<br>
p.<a href="#pxssh-setwinsize">setwinsize</a>(a[0],a[1])<br>
p = pexpect.<a href="pexpect.html#spawn">spawn</a>('/bin/bash') # Note this is global and used in sigwinch_passthrough.<br>
signal.signal(signal.SIGWINCH, sigwinch_passthrough)<br>
p.<a href="#pxssh-interact">interact</a>()</tt></dd></dl>
<dl><dt><a name="pxssh-isalive"><strong>isalive</strong></a>(self)</dt><dd><tt>This tests if the child process is running or not.<br>
This is non-blocking. If the child was terminated then this<br>
will read the exitstatus or signalstatus of the child.<br>
This returns True if the child process appears to be running or False if not.<br>
It can take literally SECONDS for Solaris to return the right status.</tt></dd></dl>
<dl><dt><a name="pxssh-isatty"><strong>isatty</strong></a>(self)</dt><dd><tt>This returns True if the file descriptor is open and connected to a tty(-like) device, else False.</tt></dd></dl>
<dl><dt><a name="pxssh-kill"><strong>kill</strong></a>(self, sig)</dt><dd><tt>This sends the given signal to the child application.<br>
In keeping with UNIX tradition it has a misleading name.<br>
It does not necessarily kill the child unless<br>
you send the right signal.</tt></dd></dl>
<dl><dt><a name="pxssh-next"><strong>next</strong></a>(self)</dt><dd><tt>This is to support iterators over a file-like object.</tt></dd></dl>
<dl><dt><a name="pxssh-read"><strong>read</strong></a>(self, size<font color="#909090">=-1</font>)</dt><dd><tt>This reads at most "size" bytes from the file <br>
(less if the read hits EOF before obtaining size bytes). <br>
If the size argument is negative or omitted, <br>
read all data until EOF is reached. <br>
The bytes are returned as a string object. <br>
An empty string is returned when EOF is encountered immediately.</tt></dd></dl>
<dl><dt><a name="pxssh-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.<br>
It includes a timeout. If the read does not complete within the<br>
timeout period then a TIMEOUT exception is raised.<br>
If the end of file is read then an EOF exception will be raised.<br>
If a log file was set using <a href="#pxssh-setlog">setlog</a>() then all data will<br>
also be written to the log file.<br>
<br>
If timeout==None then the read may block indefinitely.<br>
If timeout==-1 then the self.<strong>timeout</strong> value is used.<br>
If timeout==0 then the child is polled and <br>
if there was no data immediately ready then this will raise a TIMEOUT exception.<br>
<br>
The "timeout" refers only to the amount of time to read at least one character.<br>
This is not effected by the 'size' parameter, so if you call<br>
<a href="#pxssh-read_nonblocking">read_nonblocking</a>(size=100, timeout=30) and only one character is<br>
available right away then one character will be returned immediately. <br>
It will not wait for 30 seconds for another 99 characters to come in.<br>
<br>
This is a wrapper around os.<a href="#pxssh-read">read</a>().<br>
It uses select.select() to implement a timeout.</tt></dd></dl>
<dl><dt><a name="pxssh-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 in<br>
the string, but may be absent when a file ends with an incomplete line. <br>
Note: This <a href="#pxssh-readline">readline</a>() looks for a \r\n pair even on UNIX because<br>
this is what the pseudo tty device returns. So contrary to what you<br>
may expect you will receive the newline as \r\n.<br>
An empty string is returned when EOF is hit immediately.<br>
Currently, the size agument is mostly ignored, so this behavior is not<br>
standard for a file-like object. If size is 0 then an empty string<br>
is returned.</tt></dd></dl>
<dl><dt><a name="pxssh-readlines"><strong>readlines</strong></a>(self, sizehint<font color="#909090">=-1</font>)</dt><dd><tt>This reads until EOF using <a href="#pxssh-readline">readline</a>() and returns a list containing <br>
the lines thus read. The optional "sizehint" argument is ignored.</tt></dd></dl>
<dl><dt><a name="pxssh-send"><strong>send</strong></a>(self, str)</dt><dd><tt>This sends a string to the child process.<br>
This returns the number of bytes written.<br>
If a log file was set then the data is also written to the log.</tt></dd></dl>
<dl><dt><a name="pxssh-sendeof"><strong>sendeof</strong></a>(self)</dt><dd><tt>This sends an EOF to the child.<br>
This sends a character which causes the pending parent output<br>
buffer to be sent to the waiting child program without<br>
waiting for end-of-line. If it is the first character of the<br>
line, the <a href="#pxssh-read">read</a>() in the user program returns 0, which<br>
signifies end-of-file. This means to work as expected <br>
a <a href="#pxssh-sendeof">sendeof</a>() has to be called at the begining of a line. <br>
This method does not send a newline. It is the responsibility<br>
of the caller to ensure the eof is sent at the beginning of a line.</tt></dd></dl>
<dl><dt><a name="pxssh-sendline"><strong>sendline</strong></a>(self, str<font color="#909090">=''</font>)</dt><dd><tt>This is like <a href="#pxssh-send">send</a>(), but it adds a line feed (os.linesep).<br>
This returns the number of bytes written.</tt></dd></dl>
<dl><dt><a name="pxssh-setecho"><strong>setecho</strong></a>(self, state)</dt><dd><tt>This sets the terminal echo mode on or off.<br>
Note that anything the child sent before the echo will be lost, so<br>
you should be sure that your input buffer is empty before you setecho.<br>
For example, the following will work as expected.<br>
p = pexpect.<a href="pexpect.html#spawn">spawn</a>('cat')<br>
p.sendline ('1234') # We will see this twice (once from tty echo and again from cat).<br>
p.expect (['1234'])<br>
p.expect (['1234'])<br>
p.<a href="#pxssh-setecho">setecho</a>(False) # Turn off tty echo<br>
p.sendline ('abcd') # We will set this only once (echoed by cat).<br>
p.sendline ('wxyz') # We will set this only once (echoed by cat)<br>
p.expect (['abcd'])<br>
p.expect (['wxyz'])<br>
The following WILL NOT WORK because the lines sent before the setecho<br>
will be lost:<br>
p = pexpect.<a href="pexpect.html#spawn">spawn</a>('cat')<br>
p.sendline ('1234') # We will see this twice (once from tty echo and again from cat).<br>
p.<a href="#pxssh-setecho">setecho</a>(False) # Turn off tty echo<br>
p.sendline ('abcd') # We will set this only once (echoed by cat).<br>
p.sendline ('wxyz') # We will set this only once (echoed by cat)<br>
p.expect (['1234'])<br>
p.expect (['1234'])<br>
p.expect (['abcd'])<br>
p.expect (['wxyz'])</tt></dd></dl>
<dl><dt><a name="pxssh-setlog"><strong>setlog</strong></a>(self, fileobject)</dt><dd><tt>This method is no longer supported or allowed.</tt></dd></dl>
<dl><dt><a name="pxssh-setmaxread"><strong>setmaxread</strong></a>(self, maxread)</dt><dd><tt>This method is no longer supported or allowed.<br>
I don't like getters and setters without a good reason.</tt></dd></dl>
<dl><dt><a name="pxssh-setwinsize"><strong>setwinsize</strong></a>(self, r, c)</dt><dd><tt>This sets the terminal window size of the child tty.<br>
This will cause a SIGWINCH signal to be sent to the child.<br>
This does not change the physical window size.<br>
It changes the size reported to TTY-aware applications like<br>
vi or curses -- applications that respond to the SIGWINCH signal.</tt></dd></dl>
<dl><dt><a name="pxssh-terminate"><strong>terminate</strong></a>(self, force<font color="#909090">=False</font>)</dt><dd><tt>This forces a child process to terminate.<br>
It starts nicely with SIGHUP and SIGINT. If "force" is True then<br>
moves onto SIGKILL.<br>
This returns True if the child was terminated.<br>
This returns False if the child could not be terminated.</tt></dd></dl>
<dl><dt><a name="pxssh-wait"><strong>wait</strong></a>(self)</dt><dd><tt>This waits until the child exits. This is a blocking call.<br>
This will not read any data from the child, so this will block forever<br>
if the child has unread output and has terminated. In other words, the child<br>
may have printed output then called exit(); but, technically, the child is<br>
still alive until its output is read.</tt></dd></dl>
<dl><dt><a name="pxssh-write"><strong>write</strong></a>(self, str)</dt><dd><tt>This is similar to <a href="#pxssh-send">send</a>() except that there is no return value.</tt></dd></dl>
<dl><dt><a name="pxssh-writelines"><strong>writelines</strong></a>(self, sequence)</dt><dd><tt>This calls <a href="#pxssh-write">write</a>() for each element in the sequence.<br>
The sequence can be any iterable object producing strings, <br>
typically a list of strings. This does not add line separators<br>
There is no return value.</tt></dd></dl>
<hr>
Data and other attributes inherited from <a href="pexpect.html#spawn">pexpect.spawn</a>:<br>
<dl><dt><strong>__dict__</strong> = <dictproxy object><dd><tt>dictionary for instance variables (if defined)</tt></dl>
<dl><dt><strong>__weakref__</strong> = <attribute '__weakref__' of 'spawn' objects><dd><tt>list of weak references to the object (if defined)</tt></dl>
</td></tr></table></td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#55aa55">
<td colspan=3 valign=bottom> <br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Data</strong></big></font></td></tr>
<tr><td bgcolor="#55aa55"><tt> </tt></td><td> </td>
<td width="100%"><strong>__revision__</strong> = '$Revision: 395 $'<br>
<strong>__version__</strong> = '2.1'</td></tr></table>
</body></html>
|