如何设置/获取t给定的属性值x.
t
x
class Test: def __init__(self): self.attr1 = 1 self.attr2 = 2 t = Test() x = "attr1"
python attributes object
attributes ×1
object ×1
python ×1