Convert file into BytesIO object using python
Opening a file with open and mode read-binary already gives you a Binary I/O object. Documentation: The easiest way to create a binary stream is with open() with ‘b’ in the mode string: f = open(“myfile.jpg”, “rb”) So in normal circumstances, you’d be fine just passing the file handle wherever you need to supply it. … Read more