Re: [Tutor] Strange Appending

2004-12-03 Thread Anna Ravenscroft
mdcooper wrote: Hello, I am trying to append a list to another list, but everytime I do, the new parent list has a new child list, but all the other lists have become the same as the new child list. Code: self._f.write(str(self.residue.atoms[int(t[0])-1].element) + ' ') for m in t:

Re: [Tutor] Strange Appending

2004-12-02 Thread Liam Clarke
What's t supposed to be, what are you initialising self.a as, where is t generated, what is your expected output? What else is happening to self.a? Looks like an indentation error to me. This kind of output [[1, 237, 543], [1, 237, 543], [1, 237, 543], [1, 237, 543]] would only come from a lo

Re: [Tutor] Strange Appending

2004-12-02 Thread Marilyn Davis
On Thu, 2 Dec 2004, mdcooper wrote: > Hello, > > I am trying to append a list to another list, but everytime I do, the new > parent list has a new child list, but all the other lists have become the > same > as the new child list. > > Code: > > > self._f.write(str(self.residue.atoms[int(t[0

[Tutor] Strange Appending

2004-12-02 Thread mdcooper
Hello, I am trying to append a list to another list, but everytime I do, the new parent list has a new child list, but all the other lists have become the same as the new child list. Code: self._f.write(str(self.residue.atoms[int(t[0])-1].element) + ' ') for m in t: