To read a file into a bytearray in Python you can use the following snippet.
Sample Python
def file_to_bytes(fileName): return open(fileName, "rb").read()
All the Code Snippets and Samples you need
To read a file into a bytearray in Python you can use the following snippet.
def file_to_bytes(fileName): return open(fileName, "rb").read()
You must be logged in to post a comment.
RT @CodeSnippetsNET: How to read a file into a bytearray in #Python http://t.co/7noTsHyTI3 #programming #code