python - convert large binary file to hexadecimal (binascii.hexlify returns MemoryError) -


i trying convert large file (~1gb) hexadecimal string binascii (which works great on smaller files), causing memoryerror.

this code using:

import binascii  filepath = "demo/11.mp4.zip"  file = open(filepath, "rb") file:     byte = file.read()     hexa = binascii.hexlify(byte)  hexa_string = hexa.decode('ascii'); 

any advice?

actually approximately using 3 gb of memory storing file , hex within byte , hexa variables, instead of can iterate within file , process based on chunks .


Comments

Popular posts from this blog

timeout - Handshake_timeout on RabbitMQ using python and pika from remote vm -

gcc - MinGW's ld cannot perform PE operations on non PE output file -

c# - Search and Add Comment with OpenXML for Word -