I have a dictionary like this:
d = {'item1': ('Hi', (150, 495)), 'item2': ('Hola', (590, 40))}
I want to convert it to object, recursively if possible. I have a class:
class Item:
def __init__(self,thetuple):
self.greeting=thetuple[0]
self.coordinate=thetuple[1]
So what I want is, there should be an object, for instance item1, and item1.greeting is "Hi", item1.coordinate is (150,495) etc.
I'm open to all kinds of solutions, improvements, ideas. Thanks.