Hi

Sorry ! My mistake.

>>> myDict = {}
>>> myDict['foo'] = {}
>>> myDict['foo']['bar'] = 'works'

-----

>>> def myFunction( MyObj ):
...     # MyObj is a nested dicionary (normaly 2 steps like myDict['foo']
['bar'])
...     # I want inspect this MyObj
...     # what keys was pass
...     print MyObj.keys() ## WRONG
...     # So What I want is :
...     # return foo bar

----------------

>>> result = myFunction( myDict['foo']['bar'] )
>>> result

Should print :

... foo bar

Best Regards

macm



On Nov 11, 2:09 pm, Jon Clements <jon...@googlemail.com> wrote:
> On Nov 11, 1:31 pm, macm <moura.ma...@gmail.com> wrote:
>
> > Hi Folks
>
> > I pass a nested dictionary to a function.
>
> > def Dicty( dict[k1][k2] ):
> >         print k1
> >         print k2
>
> > There is a fast way (trick) to get k1 and k2 as string.
>
> > Whithout loop all dict. Just it!
>
> > Regards
>
> > macm
>
> I've tried to understand this, but can't tell if it's a question or
> statement, and even then can't tell what the question or statement
> is...
>
> Care to eloborate?

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to