我怎样才能完成这样的工作:
def get_foo(someobject, foostring): return someobject.foostring
IE:
如果我这样做get_foo(obj, "name")应该是调用obj.name(请参阅输入字符串,但我称之为attritube.
get_foo(obj, "name")
obj.name
谢谢
python attributes
attributes ×1
python ×1