Re: String formatting with nested dictionaries

2006-08-24 Thread Maric Michaud
Le jeudi 24 août 2006 21:02, Fredrik Lundh a écrit : > class wrapper: >      def __init__(self, dict): > self.dict = dict >      def __getitem__(self, key): > try: >    return self.dict[key] > except KeyError: >     Quite the same idea, but without eval and the

Re: String formatting with nested dictionaries

2006-08-24 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > I've got a bit of code which has a dictionary nested within another > dictionary. I'm trying to print out specific values from the inner > dict in a formatted string and I'm running into a roadblock. I can't > figure out how to get a value from the inner dict into the

Re: String formatting with nested dictionaries

2006-08-24 Thread [EMAIL PROTECTED]
Gabriel Genellina wrote: > At Thursday 24/8/2006 13:22, [EMAIL PROTECTED] wrote: > > >I've got a bit of code which has a dictionary nested within another > >dictionary. I'm trying to print out specific values from the inner > >dict in a formatted string and I'm running into a roadblock. I can't

Re: String formatting with nested dictionaries

2006-08-24 Thread Gabriel Genellina
At Thursday 24/8/2006 13:22, [EMAIL PROTECTED] wrote: I've got a bit of code which has a dictionary nested within another dictionary. I'm trying to print out specific values from the inner dict in a formatted string and I'm running into a roadblock. I can't figure out how to get a value from t

Re: String formatting with nested dictionaries

2006-08-24 Thread Diez B. Roggisch
[EMAIL PROTECTED] schrieb: > I've got a bit of code which has a dictionary nested within another > dictionary. I'm trying to print out specific values from the inner > dict in a formatted string and I'm running into a roadblock. I can't > figure out how to get a value from the inner dict into the

String formatting with nested dictionaries

2006-08-24 Thread [EMAIL PROTECTED]
I've got a bit of code which has a dictionary nested within another dictionary. I'm trying to print out specific values from the inner dict in a formatted string and I'm running into a roadblock. I can't figure out how to get a value from the inner dict into the string. To make this even more co