Manipulate numbers in python
<p>I have to write a program in python which could manipulate a serial data input to make it usable.</p>

<p>The received data looks like this:</p>

<p>eb 90 eb 90 eb 90 00 a0 18 <strong>d8 0a ba 17 00 00 30 00 a1 08 d7 0a 01 00 00 62 00 00 01 01 31 3e 01 00</strong> cb 2f 7f</p>

<p>The first 9 bytes and the last 3 are always the same.</p>

<p>So the first step would be to keep only the bolted numbers.</p>

<p>Then, because it would be too easy, to invert some of those number because some are lowbyte first but not all.</p>

<p>In fact I need to go from this:</p>

<p><strong>d8 0a ba 17 00 00 30 00 a1 08 d7 0a</strong> 01 00 00 62 00 00 01 01 31 <strong>3e 01</strong> 00</p>

<p>to this</p>

<p><strong>0ad8 17ba 0000 0030 08a1 0ad7</strong> 01 00 00 62 00 00 01 01 31 <strong>013e</strong> 00</p>

<p>Can someone lead me at least to the right documentation please?</p>

<p>Thanks a lot!</p>
