How can i send 8-bit data or binary data with pyserial?

Diez B. Roggisch deetsNOSPAM at
Tue Dec 14 13:31:49 CET 2004

> i have an electronic module which only understand binary data.
> i use  python pyserial.
> for example the module starts when 001000000 8-bit binary data sent.but
> pyserial sent only string data.
> Can i send this binary data with pyserial or another way with python.

Strings _are_ binary data. Use the module struct to convert data from more
convenient representations (numbers) to strings, or use chr() to convert
them yourself.


Diez B. Roggisch

More information about the Python-list mailing list