I need to write some methods for loading / saving some classes to and from the binary. However, I also want to be able to receive binary data from other places, such as a binary string.
In C ++, I could do this simply by using the methods of the std :: istream and std :: ostream class, which can be a file, line, console, whatever.
Does python have a similar I / O class that can be represented to represent almost any form of I / O, or at least files and memory?
source share