Is SPLIT doing the right thing?

Here is the relevent code:


FfFe = (65534).to_bytes(2, byteorder="big")

Data = b'\xff\xfeD\x00y\x00n\x00a\x00m\x00i\x00c\x00 \x00R\x00a\x00n\x00g\x00e\x00 \x00(\x00D\x00R\x00)\x00\x00\x00\xff\xfe1\x001\x00\x00\x00'

Lines = Data.split(FfFe)

Here is what shows up after the split:

Lines = {list:3}[b'', b'D\x00y\x00n\x00a\x00m\x00i\x00c\x00 \x00R\x00a\x00n\x00g\x00e\x00 \x00(\x00D\x00R\x00)\x00\x00\x00', b'1\x001\x00\x00\x00']
0 = {bytes:0}b''
1 = {bytes:38}b'D\x00y\x00n\x00a\x00m\x00i\x00c\x00 \x00R\x00a\x00n\x00g\x00e\x00 \x00(\x00D\x00R\x00)\x00\x00\x00'
2 = {bytes:6}b'1\x001\x00\x00\x00'

Where does lines[0] come from?

Please sign in to leave a comment.