scriptcwl.py 文件源码

python
阅读 25 收藏 0 点赞 0 评论 0

项目:scriptcwl 作者: NLeSC 项目源码 文件源码
def quiet():
    # save stdout/stderr
    # Jupyter doesn't support setting it back to
    # sys.__stdout__ and sys.__stderr__
    _sys_stdout = sys.stdout
    _sys_stderr = sys.stderr
    # Divert stdout and stderr to devnull
    sys.stdout = sys.stderr = open(os.devnull, "w")
    try:
        yield
    finally:
        # Revert back to standard stdout/stderr
        sys.stdout = _sys_stdout
        sys.stderr = _sys_stderr
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号