I'm trying to make a quick script that takes the text from a file, encodes the text to hex and put that in another file.
path = "C:\\..."
finalname = "example.txt"
with open(path,"r") as fr:
content = fr.read().encode("hex")
fr.close()
with open(finalname,"wb") as fw:
fw.write(content)
fw.close()
But when I was testing it I see that when the scripts works with a "big" file like 10MB or more the scripts only take a piece of the whole text, and if that piece was at the beginning of the text I would understand that they would be limitations of the .read()
function, but the piece that it picks up is in the middle of the text without any reason.