Let's say I have the following ascii hex string "4a65737573". How do I now iterate over it, wrapping a fixed amount of characters, but always incrementing by 2. i.e. 4a65, 6573, 7375...
This should do it:
In [218]: mystr = "4a65737573"
In [219]: for i in range(0, len(mystr), 2):
.....: print mystr[i:i+4]
.....:
4a65
6573
7375
7573
73
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With