Arduino Serial Monitor works but not on PySerial and PuTTY
I wrote a python application which communicated with an arduino and for some reason I had to insert a delay after opening the serial for it to work correctly, if I didn't the first data I sent would always get dropped. Perhaps that's what's occuring here? Setting the attributes of the serial connection like that is probably slower than doing it in initialisation.

For myself I found that a delay of 3 seconds was what I needed for it to work 100% correctly on all computers (on some a second was enough). You only had to wait after opening it once open it worked fine.

To do a delay import the time module and use the sleep function which takes an argument of seconds.

import time

time.sleep(3)


Also worth noting depending on your application it's worth setting a timeout value for the serial that's appropriate or just keeping it open with the timeout paramter.

 ser = serial.Serial(com, 115200, timeout=0) 


If you do this make sure to close it when you finished with it though (I personally used a try finally block which makes sure its always closed).

try:
  ser = serial.Serial(com, 115200, timeout=0)
  #go nuts with whatever communicating your doing
finally:
  ser.close()


I'm afraid I can't really tell you what caused the issue though. I also realise that this question is quite old so I hope my answer is still helpful, if not to you then to someone else who stumbles across it. To note for future the people on the official Arduino forum may be of more help for arduino related questions in general.