title: Python chat program for serial port connection (RS-232)
body: <p>I found this code for a simple chat that uses serial ports to communicate, and I wanted to see it work. I googled for a while and found com0com to simulate the RS-232 connection as I don't have a cable, but now I'm stumped and have no idea how to actually make this work</p>
  
  <p>The code (in python):</p>
  
  <pre><code>from serial import * 
  from threading import Thread 
  
  class Receiver(Thread): 
      def __init__(self, serialPort): 
          Thread.__init__(self) 
          self.serialPort = serialPort 
      def run(self): 
          text = "" 
          while (text != "exit\n"): 
              text = serialPort.readline() 
              print ("\n machine1: " + text) 
          self.serialPort.close() 
  
  class Sender(Thread): 
      def __init__(self, serialPort): 
          Thread.__init__(self) 
          self.serialPort = serialPort 
      def run(self): 
          text = "" 
          while(text != "exit\n"): 
              text = raw_input("Type your message&gt;&gt;") + "\n" 
              self.serialPort.write(text) 
          self.serialPort.close() 
  
  serialPort = Serial("\\\\.\\CNCA0")
  
  send = Sender(serialPort) 
  receive = Receiver(serialPort) 
  send.start() 
  receive.start()
  </code></pre>
  
  <p>Thanks in advance.</p>