Python使用内置函数setattr设置对象的属性值

game42771 21 0 PDF 2020-12-17 13:12:30

英文文档: setattr(object, name, value) This is the counterpart of getattr(). The arguments are an object, a string and an arbitrary value. The string may name an existing attribute or a new attribute. The function assigns the value to the attribute, provided the object allows it. For example, setattr(x,

用户评论
请输入评论内容
评分:
暂无评论