Home > Back-end >  How to read binary file and write to .txt file
How to read binary file and write to .txt file

Time:04-03

I have a file.binary like this:

3388AB88FFAC88BBAC88hello88

I want to export it to a text file.

CodePudding user response:

with open("binary_file", "rb") as bin_file, open("text_file.txt", "w") as text_file:
    text_file.write(bin_file.read().decode())
  • Related