A lot of hardware serial devices use a carriage return to signal the end of a line or instruction. Without knowing what device you are trying to communicate wth (or the protocol it expects), I would probably suggest trying
ser.write("x0\r")
ser.flush()
ser.write("11\r")
As indicated in the documentation, pySerial does not support EOL parameters for readline()
any longer so if the device is returning replies to you (and is doing so with \r
terminated lines) then you should do as advised and use io.TextIOWrapper
and appropriate timeouts to parse incoming data as well.