would this work?

>>>
a="fe01b84100000000000000002756fe02fe01b94100000000000000006239fe02fe01ba410000000000000000ad88fe02fe01bb410000000000000000e8e7fe02fe01bc41000000000000000012fbfe02fe01bd4100000000000000005794fe02"
>>> b=a.replace('fe02fe01','fe02\nfe01').split('\n')


>>> for c in b:
...     print ' '.join([c[i:i+2] for i in range(0, len(c), 2)])
...
fe 01 b8 41 00 00 00 00 00 00 00 00 27 56 fe 02
fe 01 b9 41 00 00 00 00 00 00 00 00 62 39 fe 02
fe 01 ba 41 00 00 00 00 00 00 00 00 ad 88 fe 02
fe 01 bb 41 00 00 00 00 00 00 00 00 e8 e7 fe 02
fe 01 bc 41 00 00 00 00 00 00 00 00 12 fb fe 02
fe 01 bd 41 00 00 00 00 00 00 00 00 57 94 fe 02


On Wed, Dec 3, 2014 at 12:18 PM, shweta kaushik <coolshw...@gmail.com>
wrote:

> Hi,
>
> I need help for doing this task. I know it will be simple but I am not
> able to do it.
>
>
> output_message_packet= 
> fe01b84100000000000000002756fe02fe01b94100000000000000006239fe02fe01ba410000000000000000ad88fe02fe01bb410000000000000000e8e7fe02fe01bc41000000000000000012fbfe02fe01bd4100000000000000005794fe02
>
> I want to split this into separate message packets like this:
> fe01b84100000000000000002756fe02
> fe01b94100000000000000006239fe02
> fe01ba410000000000000000ad88fe02
> fe01bb410000000000000000e8e7fe02
> fe01bc41000000000000000012fbfe02
> fe01bd4100000000000000005794fe02
>
> After this I want to split this into bytes:
> fe 01 b8 41 00 00 00 00 00 00 00 00 27 56 fe 02
>
> Please help me with code for how to do this.
>
> Thanks in advance.
>
> Regards,
> Shweta
>
> _______________________________________________
> Tutor maillist  -  Tutor@python.org
> To unsubscribe or change subscription options:
> https://mail.python.org/mailman/listinfo/tutor
>
>
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor

Reply via email to