Re: [Tutor] Objects in List (fwd)

2005-05-17 Thread Danny Yoo
> Hi Danny > > Thanks, it works - I must read the documentation more carefully! > > Would you mind if I knok on your door again with futher Python hick-ups? Hi Danie, It's probably a better idea to send your questions to Tutor. The reason is to allow the community to get involved. Also, I have

Re: [Tutor] Objects in List

2005-05-16 Thread Terry Carroll
On Mon, 16 May 2005, Viljoen, Danie wrote: > My Code: > > class MyObject: > """A simple VO class""" > def setName(self, newName): > self.name=newName > > def getName(self): > return self.name > > def main(): > list=[] >

Re: [Tutor] Objects in List

2005-05-16 Thread Danny Yoo
Hi Danie, The enumerate() function takes a list of elements, and returns a list of (index, element) pairs. For example: ## >>> names = ["wilma", "fred", "betty", "barney"] >>> for p in enumerate(names): ... print p ... (0, 'wilma') (1, 'fred') (2, 'betty') (3, 'barney') ## Note th

[Tutor] Objects in List

2005-05-16 Thread Viljoen, Danie
Title: Objects in List Hi I'm new to python (have a java background).  I'm trying to add object to a list, and afterwards manipulate the object again.  How do a cast a object to another object My Code: class MyObject:        """A simple VO class"""     def setName(self, newNa