Hi,
PySerial API says that the correct way of using readline() is
readline(size=None, eol='\n')
However when I try to use it with parameters I get:
str = s.readlines(eol='\n')
TypeError: readlines() takes no keyword arguments
How can I change default EOL ?
Thanks,
Jakub
On newer Python's, pySerial is inheriting from the io module which does not support this parameter.
To gain control over new lines, wrap the serial port object using io.TextIOWrapper. This also gives the opportunity to specify the encoding (pySerial just reads 'raw' bytes).
see also http://docs.python.org/library/io.html#io.TextIOWrapper
I'll add an other note about this to the docs.