Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- list = [0x1, 0x2, 0x3, 0x4, 0x5, 0x6]
- def chunks(l, n):
- "Yield successive n-sized chunks from l."""
- for i in range(0, len(l), n):
- yield l[i:i + n]
- for c in chunks(list, 2):
- print c
- b = (c[0] << 8) + c[1]
- print hex(b)
Add Comment
Please, Sign In to add comment