Answers for "convert python file to a binary"

3

write binary file in python

file = open("sample.bin", "wb")
COPYfile.write(b"This binary string will be written to sample.bin")
COPYfile.close()
Posted by: Guest on January-08-2021
0

python read binary

with open("data.bin", "rb") as data:
  byte = data.read()

print(byte)
Posted by: Guest on May-23-2021

Code answers related to "convert python file to a binary"

Python Answers by Framework

Browse Popular Code Answers by Language