binary string question

Dan Jones djones at shcorp.com
Fri Nov 7 22:55:17 CET 2003


Hello,

I'm trying to figure out how to get bit operators to work on a binary
string. This is what I'm trying to do:

list(frame) #where frame is a binary string
y = frame[x] << 8

It gives me a TypeError. Whats the best way to get around that? I think
the struct module may be what I'm looking for, if so could someone give
me an example? Also, is there a better way to be able to access
individual bytes than converting the string to a list?

Thanks,

Dan Jones






More information about the Python-list mailing list