Check out the 'struct' module, this allows you to read and write binary
strings. eg...
eg.
>>> from struct import pack, unpack
>>> delim = ':'
>>> code = 'U'
>>> x = 14
>>> y = 12
>>> data = pack('cchh', delim, code, x, y)
>>> data
':U\x0e\x00\x0c\x00'
>>
>>> d, c, x, y = unpack('cchh', data)
>>
You are most likey getting the result
in binary - the python interpreter is
just being nice and showing you the results
so you can read them.
try these lines:
>>>s = ser.read(4)
>>>print len(s)
>>>print [ord(b) for b in s]
mike
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAI
There is a PySerial module:
http://www.taupro.com/Downloads/pyserial.html
You might have more luck asking on [EMAIL PROTECTED], as well.
Your problem has likely been discussed there before. Here are some
python-list discussions on the PySerial module:
http://aspn.activestate.com/ASPN/sea