title: pexpect prompt for blank space in python
body: <p>Can any one please tell me, what is the prompt we have to give for expecting a blank space for a python script.I need to execute a command which will execute only after it sees the expect prompt.On doing manually i got that the prompt is a blank space,and has to expect the same prompt via script also.</p>
  
  <p>import pexpect
  import pxssh
  import time
  import os,re,sys</p>
  
  <p>def ssh(ipaddr,password):
      try:</p>
  
  <pre><code>    ss = pexpect.spawn(ipaddr)
      print ipaddr    
          ss.logfile = open("/tmp/mynewlog", "a")
          print "SSH connecting"
          print 
  except:
      print "connection refused"
      print
      #sys.exit()
  
      try:
          print password
          ss.expect (':')
  
              ss.sendline (password +"\n")
              print "connected"
              time.sleep(30)
              ss.expect ("&gt;")
              print "connection established"
              print
  
      except:
              print "Permission denied, please try again."
                  print
                  sys.exit()
      try:
          ss.sendline ('taskkill /F /IM iperf.exe\n')
          time.sleep(30)
          ss.expect ('&gt;')
              ss.sendline ('cd /D D:\iperf-2.0.5-2-win32\n')
              ss.expect ('&gt;')
              ss.sendline ('iperf -s\n')#########This command i need to execute and i'm  expecting a blank space as prompt
              ss.sendline (pexpect.EOF)
              print "END"
              ssh()  
  </code></pre>
  
  <p>except: 
                 print "Failed to execute the command"<br>
                 print
                 sys.exit()</p>