On Fri, Oct 05, 2018 at 04:17:53PM -0400, Chip Wachob wrote: > Hello, > > I was not able to find any answers in the archive on this one. > > I'm wondering if this task can be done in a better way than what I've > attempted.. > > I have an array of bytes. Up to 64, which makes for 512 bits. > > I am reading these bytes in serially, and once I have a collection of > them, I want to shift them by 'n' bits. The size of the array and the > number of bits are both variable up to the limit of 64/512.
Code speaks much more strongly than description. Can you demonstrate an example of: - the actual data you have; - the result you want; - what you've tried? The answers we give will be very different according to what you have, e.g.: data = [0, 1, 2, 3, 4, 5, 6, 7] # eight bytes in a list data = b"\0\x01\x02\x03\x04\x05\x06\x07" # eight bytes in a bytes object data = 0x0001020304050607 # eight bytes in an int -- Steve _______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor