title: Serial port writing style
body: <p>I am using two libraries to connect with a port, and two of them uses different styles in writing these commands. I want to understand the difference because I want to use the second one, but it results in port becoming unresponsive after some time, I wonder if it causes a kind of overloading. Here are the methods.</p>
  
  <p><strong>Method 1:</strong></p>
  
  <pre><code> if self.port:
       self.port.flushOutput()
       self.port.flushInput()
       for c in cmd:
           self.port.write(c)
       self.port.write("\r\n")
  </code></pre>
  
  <p><strong>Method 2:</strong></p>
  
  <pre><code>if self.port:
      cmd += b"\r\n"
      self.port.flushInput() 
      self.port.write(cmd)
      self.port.flush()
  </code></pre>
  
  <p>The major difference I first encounter is that the first one splitting the command in to letters then send it. I wonder if this makes any difference. And as I said the second code fails after some time( it is unclear, if these methods are the problem). I don't understand what flushes do there. I want to understand the difference between these and know if the second one prone to errors.</p>
  
  <p><strong>Note:</strong> Please note that <code>self.port</code> is <code>serial.Serial</code> object.</p>
  
  <p>Any advice appreciated.</p>