psSerial: how to write a single byte value to the serial port?

Mike Meyer mwm at
Wed Nov 17 21:49:25 CET 2004

"Diez B. Roggisch" <deetsNOSPAM at> writes:

>> I assume the string print ser.write() will append null characters to the
>> end.
> Why do you assume that? Its not said anywhere, and its wrong. A string
> consists only of the characters you can "see" - if python usues C
> convention for 0-termination or othear means is an implementation detail
> none of your concern.

Actually, it is of my concern. I need to know whether I can put null
bytes in a string or not. If Python used the C convention, I
couldn't. Since it doesn't, I can.

Mike Meyer <mwm at>
Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information.

More information about the Python-list mailing list