Can't use pyserial to read serial data from Arduino

PaulS:

My Arduino is running this code:

Serial.write("test");

Why? Are you sending binary data somewhere? No, you are not. You should be using Serial.print() to send ASCII data.

Opening the serial port, by pyserial, resets the Arduino. It does not look like your pyserial code does any kind of looping. The code to read the Arduino output appears to expect data once, immediately. Since there is no data available immediately, the pyserial code gives up and moves on.

Here's the implementation of write(char *) from Print.h in the arduino core:

size_t write(const char *str) { return write((const uint8_t *)str, strlen(str)); }

Here's the implementation of print(char *) from Print.cpp in the arduino core:

size_t Print::print(const char str[])
{
  return write(str);
}

Pauls, can we stop this senseless attack on the use of write to send strings to Serial? No bits are being harmed.