Using Seek method to read on from a file header location in a bitstream

I appear to have gone down a "blind alley" here. Having identified the location of the Word perfect headers, I need to verify that they are indeed genuine by reading the hex value 10 bytes from the beginning of the header. If it is \x0A, then I can confirm the header is genuine.

I am trying to use the "read", "seek" and "tell" methods to report the presence \x0a, 10 bytes in from the discovered header location. The size of the bitstream , meant that I had to read it in buffer chunks, which was fine for reporting the header locations. I would appear to be restricted to the While data loop.

import re
WORDPERFECT="\x0a"
with open(wordsearch,"rb")as word:
buff=word.read()# You can also just read a small buffer to check. word.read(10)
if re.search("^(\\x0a)$", buff,re.M ):
print("Wordperfect registered")
print(buff.find(WORDPERFECT))

import re
WORDPERFECT="\x0a"
with open(wordsearch,"rb")as word:
buff=word.read()# You can also just read a small buffer to check. word.read(10)
if re.search("^(\\x0a)$", buff,re.M ):
print("Wordperfect registered")
print(buff.find(WORDPERFECT))

Thanks, Richie,

I will look closer at this as it should be useful for other attribute strings further past the point I wish to check, first off.