reporter.py 文件源码

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

项目:progress_reporter 作者: marscher 项目源码 文件源码
def _attached_to_ipy_notebook_with_widgets():
    try:
        # check for widgets
        import ipywidgets
        if ipywidgets.version_info[0] < 4:
            raise ImportError()
        # check for ipython kernel
        from IPython import get_ipython
        ip = get_ipython()
        if ip is None:
            return False
        if not getattr(ip, 'kernel', None):
            return False
        # No further checks are feasible
        return True
    except ImportError:
        return False
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号