__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