title: Pyserial write() hangs
body: <p>I need to communicate with some device using serial port. I know this device parameters (boudrate etc.). I also know that this device waits untill it receives a new line character (I don't know unix or windows type) and then sends back something in ASCII.</p>
  
  <p>The problem is that when i want to write anything the script hangs. No error occurs, just nothing happens later. It's impossible to print anything or even to close the port.</p>
  
  <p>How can I fix that?</p>
  
  <p>It doesn't work for really basic script. Of course this is no a whole code, just an example to present what is not working.</p>
  
  <p>Sadly, I didn't find any explanation or an answer which works.</p>
  
  <p>I'm working on Ubuntu 16.04</p>
  
  <p>Thanks for your help!</p>
  
  <pre><code>import serial
  
  ser = serial.Serial(
  port="/dev/NameOfDevice",
  baudrate=115200,
  bytesize=8,
  parity='N',
  stopbits=1,
  timeout = 0)
  
  ser.open()
  print('Port was opened')
  
  ser.write(b'\r\n') #this is a line where it stops working. Different inputs were tried, nothing works.
  print('Does it works?')
  </code></pre>