Re: More than one element of list changing when only one should be

2008-06-09 Thread Peter Otten
Chuckk Hubbard wrote: > I can't think of any reason these lines: > > self.regionlist[self.hregion][0] = self.curnum > self.regionlist[self.hregion][1] = self.curden > self.regionlist[self.hregion][3] = self.octave11 = self.yadj > > should change self.regionlist[0] AND self.regionlist[2] in the s

More than one element of list changing when only one should be

2008-06-09 Thread Chuckk Hubbard
Hello. This program is clunky, I know; I'm not a programmer, but I need to use this program, so I'm writing it. The problem: I have a cursor following the mouse that shows frequency ratios of potential notes in relation to 1/1 (something like Middle C). At any time, the user may hit "t" to move 1/

Re: More than one element of list changing when only one should be

2008-06-07 Thread Chuckk Hubbard
I solved this problem. I still don't understand why, but it seems Python was appending a reference to the first element at the end of the list, rather than copying the data. I used something like: "self.regionlist.append(list(self.regionlist[self.hregion])" and now it works fine, i.e., altering t