title: Python:Running multiple session at a time without closing the other sessions
body: <p>i need a help for solving this issue, i'm running a python script for checking UDP data transfer between two pcs using IPERF.Problem is, after first telnet and configuration it closes the server session and open the client session which creates an error from iperf server.   </p>
  
  <pre><code> def tc01server(ipaddr,login,password):            
          try:
                ss = pexpect.spawn(ipaddr)
                print ss
                ss.expect (":")
                #ss.logfile = open("/tmp/telnetlog", "a") 
                ss.logfile = sys.stdout
                print "connected to telnet"
                print 
          except:
                print "telconnnet connection refused"
                print 
                sys.exit()
          try:
                ss.send(login + "\r")
                ss.expect(":")
                ss.send(password + "\r")
                ss.send("\r\n")
  
          except:
                print "telconnnet connection refused"
                print 
                sys.exit()     
  
      def tc01client(ipaddr,login,password):            
          try:
                css = pexpect.spawn(ipaddr)
                print css
                css.expect (":")
                css.logfile = open("/tmp/mynewlog", "w")
                #css.logfile = sys.stdout
                print "connected to telnet"
                print
          except:
                print "telnet connection refused"
                print
                sys.exit()
          try:
                css.send(login + "\r")
                css.expect(":")
                print "connected"
                css.send(password + "\r")
                css.send("\r\n")
          except:
                print "telconnnet connection refused"
                print 
                sys.exit() 
  </code></pre>
  
  <p>can anyone please tell me how to run multiple session at a time without closing the other.Thanks in advance.Let me know if not clear.</p>