print names of dictionaries

BartlebyScrivener rpdooling at gmail.com
Wed Apr 26 18:05:19 EDT 2006


Yikes,

I'll have to come back to the OO way in a month or two ;)

This works for now. I just added their names as values:

def printdict(dictionaries=[apps, dirs, sites]):
       for dictionary in dictionaries:
              print dictionary["name"]
              keys = dictionary.keys()
              keys.sort()
              for key in keys:
                     if key != "name":
                            print key, ":",dictionary[key]
              print '\n',

Thank you both for your help. 

rpd




More information about the Python-list mailing list