I have a bytearray object in Python 2.7 that I got from a query to an SQL server and I know that it is a zip file. What I need to do now is access the data in the zip file.
How can I convert the bytearray into the file and safe it to the hard disc?
How can I access the data in the zip file directly in Python?
To “convert” it into a file: Write the bytearray to disk without changing anything (be sure to open the file for writing with “wb”). To access its content without saving to disk, embed it into a
stringioobject (which mimics an open file) and access it withzipfile.