title: pexpect to expect more than one pattern
body: <pre><code>import pexpect # importing the python-expect
  child = pexpect.spawn ('telnet x.x.x.x y')
  child.expect ('Hit \[Enter\] to boot immediately\, or space bar for command prompt.', 300)
  child.send ('\x20')
  if child.expect ('loader&gt;' or 'OK ', 10):
     child.sendline ('boot -s')
  </code></pre>
  
  <p>What I am trying to do here is: </p>
  
  <ul>
  <li>automating login to single user mode for a device by parsing boot sequence. </li>
  <li>Connecting to the device using a terminal server over the console port. $ I am using pexpect as the boot sequence is a single line output. </li>
  <li>pexpect work for 'loader>' or 'OK ' separately &amp; execute the next line but not together.</li>
  </ul>