Need a bit of help with a list..

rh0dium steven.klass at gmail.com
Sun Feb 12 17:45:38 EST 2006


Hi all,


Why doesn't this work as expected..  I expect that the the lines within
the sections will get modified - permanently.  It is modifying them
during the first section but they never get saved to the new values..
Can anyone help me and even better explain why it's not working..

        for section in self.sections:
            nidx = 0
            for line in self.sections[section]:
                if re.match(r"^.*\+$",line):
                    line = line[:-1]
                    line = line + " " + self.sections[section][nidx+1]
                    print nidx, "+ found -total lines",
len(self.sections[section]), line
                    del self.sections[section][nidx+1]
                    nidx += 1
                else:
                    nidx += 1

        for secs in self.sections:
            print " %s" % secs
            for line in self.sections[secs]:
                 print "  %s" % line

self.section[foo]=["Param_Set primitive:rdv_AIO_reg50_top_IPTOP
id:chip_top_pads!reg50ma +",
"    VDD18:VDD1_CR18 VDD33:VDD1_CR33 VSSA:VSSCORE", "Param_Set
instance:chip_top_pads!PAD_3    APAD:PIN_VTRIP_IN + ", " RC:RC_5A
VDDCR:VDD1_CR18 VDDIO:VDD1_IO33 VSSCR:VSSCORE +"," VDDIO5:VDD1_IO5A
VDDIO5DIV2:VDD1_IO5DIV2A VSSIO:VSS_IO"]

Many thanks!!




More information about the Python-list mailing list