Dictionaries -- ahh the fun.. (newbie help)

rh0dium steven.klass at gmail.com
Wed May 10 00:17:09 CEST 2006


Hi all,

Can someone help me out.  I am trying to determing for each run whether
or not the test should pass or fail but I can't seem to access the
results ..

Alternatively can someone suggest a better structure ( and a lesson as
to the reasoning ) that would be great too!!

cells={}

cells["NOR3X1"]= {
                    'run'       : [ 'lvs', 'drc' ],
                    'results'   : [{ 'lvs' : 'pass' },
                                   { 'drc' : 'fail' }]
                 }

cells["OR3X1"] = {
                    'run'       : [ 'lvs' ],
                    'results'   : [{ 'lvs' : 'pass' }]
                 }

cells["AND3X1"] = {
                    'run'       : [ 'drc' ],
                    'results'   : [{ 'drc' : 'fail' }]
                 }


def main():

    for cell in cells:
        print cell
        for run in cells[cell]['run']:
            print cell, run, "should",
cells[cell]['results'].index(run)


I would expect the following

OR3X1
OR3X1 lvs should pass
NOR3X1
NOR3X1 lvs should pass
NOR3X1 drc should fail
AND3X1
AND3X1 drc should fail




More information about the Python-list mailing list