mirror of
https://github.com/pyecharts/pyecharts.git
synced 2025-12-08 20:59:23 +00:00
21 lines
357 B
Python
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)
|