Novice Novice - 6 months ago 20
Python Question

Extract a particular field in '\xxx\xxx\xxx\xxx\xxx\' format in python?

So my string looks likes this:

"\177\260\002\377\004\210\005\001ABC 01\000\000\000\000\000\00074
0-053352\000\0001GD14222393\000\000\r\013\007\336\000\000\377\377\377\377\377\37
7\377\377\377\377\377\377\377\377\377\377\377\001CMUPACSDBHBBU-HHW-AC-BFG\000\
000\000\000\000\000\000A00\377\377\377\377\377\377\377\377\377\377\177\000\000\0
00\000\000\000\000\000\000\000\000\000"


I want to extract
00074 0-053352
and
001CMUPACSDBHBBU-HHW-AC-BFG
and I was wondering if there is any sophisticated way to do this?

Answer
sequences = [part for part in mystring.split("\\") if not part.isdigit()]

?