hex array to array of 16 bit numbers?

Todd Gardner piir at earthlink.net
Thu Dec 25 11:06:02 CET 2003


Hello everyone,

I would really appreciate some of your expertise or even just
pointers.  How do I convert this hex array variable "buffer" to array
of 16 bit numbers?

>>> 
>>> from ctypes import *
>>> buffer = c_buffer(8)
>>> status = ni.DAQ_Op (deviceNumber, chan, gain, buffer, count,
sampleRate)
>>> print "repr(buffer.raw) =", repr(buffer.raw)

repr(buffer.raw)= '\xcd\x00\xce\x00\xce\x00\xce\x00'
>>> 

Any ideas would be greatly appreciated!

Todd




More information about the Python-list mailing list