How do you set/get the values of attributes of t given by x?
class Test:
def __init__(self):
self.attr1 = 1
self.attr2 = 2
t = Test()
x = "attr1"
Note that the same technique also covers the issue of Call method from string. Fundamentally, that is two problems: accessing the method (which is just an instance of the same problem here), and calling what was accessed (which is trivial, and works the same way as if it had been accessed normally).
In fact, Calling a function of a module by using its name (a string) is really the same problem as well - but it may not be obvious that a module is an "object" with "attributes" that work the same way.