Python中如何动态获取和设置对象的属性? 2020-01-31T12:09:49 if hasattr(Parent, 'x'): print(getattr(Parent, 'x')) setattr(Parent, 'x',3) print(getattr(Parent,'x')) 当前页面是本站的「Baidu MIP」版。发表评论请点击:完整版 »