title: Python 'ser.write' permanently stalls program on Windows, possible errors?
body: <p>I am communicating in my python code to arduino, transmitting a number of bytes serially. The below code is my main function that works until after the first or second 'ser.wrte' function. Confusingly the program works correctly on mac with no errors but has the above issue with any laptop running windows (versions 7 and 10 have been tested with no success) is there any code-based reason for this, or is it due to a windows related serial port issue?</p>
  
  <pre><code>#Communicates to arduino via serial port
  def pump():
  print('****************')
  if len(seq) == 0:
      print("EmptySeqError: please store patterns in the sequence before sending it!")
      return
  #######################
  port = "COM17"
  macport = "/dev/cu.usbmodem1411"
  baudrate = 9600
  ####################### 
  try:
      ser = serial.Serial(port, baudrate, timeout=0.1) #, write_timeout=0.1)
  except serial.SerialException:
      print('SerialException: cannot create serial object')
      return
  else:
      if ser.isOpen():
          print('serial port {} is opened successfully!'.format(ser.name))
  for json in seq:
      MSB = int(json['Hex Code MSB'], 16)
      LSB = int(json['Hex Code LSB'], 16)
      V = int(json['Voltage'], 16) #For voltage transmission
      Vlsb = V &amp; 0xff              #Voltage LSB
      Vmsb = (V&gt;&gt;8) &amp; 0xff         #Voltage MSB
      print(V, 'in hex =', hex(V))
      print(Vlsb, 'in hex =', hex(Vlsb))
      print(Vmsb, 'in hex =', hex(Vmsb))
      #X = int(json['Xhigh'], 16)
      #Y = int(json['Ybase'], 16)
      #Z = int(json['Zsec'], 16)
      HD = int(json['High Delay'], 16)
      LD = int(json['Low Delay'], 16)
      print("**************")
      print("(MSB/LSB) number of bytes written: ", ser.write(bytes([MSB, LSB])))
      print("(Voltage) number of bytes written: ", ser.write(bytes([Vmsb,Vlsb])))
      print("(HD/LD) number of bytes written: ", ser.write(bytes([HD, LD])))
  print("serial is closing...")
  sys.stdout.flush()
  ser.close()
  #End of sending
  </code></pre>