I've a strange behaviour that I don't understand :
If I open my file , I find my bytes , but only once at a time :
f = open('d:\BB.ki', "rb")
f10 = re.findall( b'\x03\x00\x00\x10''(.*?)''\xF7\x00\xF0', f.read() )
print f10
['1BBBAAAABBBBAAAABBBBAAAABBBBAAAA\x00']
f = open('d:\BB.ki', "rb")
f11 = re.findall( b'\x03\x00\x00\x11''(.*?)''\xF7\x00\xF0', f.read() )
print f11
['2AAABBBBAAAABBBBAAAA\x00']
If I try to opening the file and getting severall bytes , I only get the 1st one (f11 is empty )
f = open('d:\BB.ki', "rb")
f10 = re.findall( b'\x03\x00\x00\x10''(.*?)''\xF7\x00\xF0', f.read() )
f11 = re.findall( b'\x03\x00\x00\x11''(.*?)''\xF7\x00\xF0', f.read() )
print f10,f11
['1BBBAAAABBBBAAAABBBBAAAABBBBAAAA\x00'] **[]**
May I use a loop , or something similar ?
Thanks
f.seek(0)to reset the file stream pointer to the beginning of the file, and then the secondread()will work :)