for key, value in dict.<func>() - how to get? (which func)

Gary Duzan mgi820 at motorola.com
Tue Aug 11 21:44:49 CEST 2009


In article <e3e8255f-0158-481b-8c96-fb20261f7ad6 at v36g2000yqv.googlegroups.com>,
dmitrey  <dmitrey.kroshko at scipy.org> wrote:
>hi all,
>which method should I use to get iterator over (key, value) pairs for
>Python dict, Python v 2.6 and above?

   dict.iteritems()

>>> import sys
>>> for (key, value) in sys.modules.iteritems(): print key, value

					Gary Duzan
					Motorola H&NM





More information about the Python-list mailing list