如何使Prophet的输出静音?

2024-03-29 07:43:15 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在使用Prophet(Facebook的时间序列库),它能产生大量的输出。大概是这样的: Prophet output

我已经对这样的输出保持沉默:

@contextmanager
def suppress_stdout():
    with open(os.devnull, "w") as devnull:
        old_stdout = sys.stdout
        sys.stdout = devnull
        try:  
            yield
        finally:
            sys.stdout = old_stdout

但它并没有使所有类型的输出都静音,我怎么能使所有类型的输出都静音呢


Tags: 类型outputfacebookdefwithstdoutsys时间