By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
464,663 Members | 1,304 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 464,663 IT Pros & Developers. It's quick & easy.

Getting bytes using set stride.

P: 1
I have a byte array
b'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A`'
what i am trying to do is get lets say 2 values starting at x position every 4 bytes
so the new byte array would be
so if my position was 0 in the stride and I want 2 bytes and the stride is 4 this would be the end result
b'\x00\x01\x04\x05\x08\x09'

basically I want to do this
a[start:end:step]
but i want to grab more then 1 byte with the step.
Nov 28 '13 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.