pyecharts/test/__init__.py
2023-04-06 17:04:24 +08:00

21 lines
357 B
Python

import sys
class ConsoleOutputRedirect:
"""Wrapper to redirect stdout or stderr"""
def __init__(self, fp):
self.fp = fp
def write(self, s):
self.fp.write(s)
def writelines(self, lines):
self.fp.writelines(lines)
def flush(self):
self.fp.flush()
stdout_redirect = ConsoleOutputRedirect(sys.stdout)