跳转至

__init__.py

baiduspider.models.__init__ special ⚓︎

get_attr(d, t) ⚓︎

获取字典d下的t

Source code in baiduspider\models\__init__.py
def get_attr(d: dict, t: str):
    """获取字典`d`下的`t`"""
    try:
        return d[t]
    except:
        return None

评论

Back to top