我正在尝试使用binascii将一个大文件(约1GB)转换为十六进制字符串(对于较小的文件效果很好),但是它会导致MemoryError。
这是我正在使用的代码:
import binascii
filePath = "demo/11.mp4.zip"
file = open(filePath, "rb")
with file:
byte = file.read()
hexa = binascii.hexlify(byte)
hexa_string = hexa.decode('ascii');
任何建议?