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

twig - Using Twigbridge in a Laravel 5.1 Package -

jdbc - Not able to establish database connection in eclipse -

firemonkey - How do I make a beep sound in Android using Delphi and the API? -