A flexible IO object that wraps path, file or fd.
Open a terminal, and run:
python -m pip install git+https://github.com/limoiie/flexio.git@masterFlexIO can wrap either path, or file, or io, or fd into an io object:
from flexio import FlexTextIO
with FlexTextIO('/path/to/file', mode='w+') as file_io:
file_io.write('some logs to file')
with FlexTextIO() as in_mem_io:
in_mem_io.write('some logs to memory')
with FlexTextIO(in_mem_io) as io:
io.read()