<div dir="ltr">would this work?<br><br>>>> a="fe01b84100000000000000002756fe02fe01b94100000000000000006239fe02fe01ba410000000000000000ad88fe02fe01bb410000000000000000e8e7fe02fe01bc41000000000000000012fbfe02fe01bd4100000000000000005794fe02"<br>>>> b=a.replace('fe02fe01','fe02\nfe01').split('\n')<br><br><br>>>> for c in b:<br>...     print ' '.join([c[i:i+2] for i in range(0, len(c), 2)])<br>...<br>fe 01 b8 41 00 00 00 00 00 00 00 00 27 56 fe 02<br>fe 01 b9 41 00 00 00 00 00 00 00 00 62 39 fe 02<br>fe 01 ba 41 00 00 00 00 00 00 00 00 ad 88 fe 02<br>fe 01 bb 41 00 00 00 00 00 00 00 00 e8 e7 fe 02<br>fe 01 bc 41 00 00 00 00 00 00 00 00 12 fb fe 02<br>fe 01 bd 41 00 00 00 00 00 00 00 00 57 94 fe 02<br><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Dec 3, 2014 at 12:18 PM, shweta kaushik <span dir="ltr"><<a href="mailto:coolshwetu@gmail.com" target="_blank">coolshwetu@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi,<div><br></div><div>I need help for doing this task. I know it will be simple but I am not able to do it.</div><div><br></div><div>output_message_packet= fe01b84100000000000000002756fe02fe01b94100000000000000006239fe02fe01ba410000000000000000ad88fe02fe01bb410000000000000000e8e7fe02fe01bc41000000000000000012fbfe02fe01bd4100000000000000005794fe02</div><div><br></div><div>I want to split this into separate message packets like this:</div><div>fe01b84100000000000000002756fe02<br></div><div>fe01b94100000000000000006239fe02<br></div><div>fe01ba410000000000000000ad88fe02<br></div><div>fe01bb410000000000000000e8e7fe02<br></div><div>fe01bc41000000000000000012fbfe02<br></div><div>fe01bd4100000000000000005794fe02<br></div><div><br></div><div>After this I want to split this into bytes:</div><div>fe 01 b8 41 00 00 00 00 00 00 00 00 27 56 fe 02<br></div><div><br></div><div>Please help me with code for how to do this.</div><div><br></div><div>Thanks in advance.</div><div><br></div><div>Regards,</div><div>Shweta </div></div>
<br>_______________________________________________<br>
Tutor maillist  -  <a href="mailto:Tutor@python.org">Tutor@python.org</a><br>
To unsubscribe or change subscription options:<br>
<a href="https://mail.python.org/mailman/listinfo/tutor" target="_blank">https://mail.python.org/mailman/listinfo/tutor</a><br>
<br></blockquote></div><br></div>