Re: [Tutor] Creating & Handling lots of objects

2004-12-03 Thread Alan Gauld
> Although I have never done so, I believe you can also > store/manipulate objects in a database. You can but its a lot slower than memory - but a lot more scaleale too! > Has anyone ever worked this option? Yes, lots of times. In fact most large scale projects will need to save objects to so

Re: [Tutor] Creating & Handling lots of objects

2004-12-03 Thread Alan Gauld
> I've written a class, with some methods. I then want to be able to call > the class repeatedly, to create some objects. The number of objects, and > some of their initialisation parameters need to be specified later (i.e. > at run-time). Not quite sure what you mean by the last bit but I'll com

RE: [Tutor] Creating & Handling lots of objects

2004-12-03 Thread Robert, Andrew
: [EMAIL PROTECTED] Linux User Number: #201204 -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Kent Johnson Sent: Friday, December 03, 2004 7:42 AM To: Python Tutor Subject: Re: [Tutor] Creating & Handling lots of objects If you want to be able to access

Re: [Tutor] Creating & Handling lots of objects

2004-12-03 Thread Kent Johnson
If you want to be able to access the objects by name, you can put them in a dict. For example, MyObjects={} l=["a","b","c"] for i in l: MyObjects[i] = MyClass(i) Then you can refer to MyObjects["a"] If all the operations on the objects are done to all objects in a batch, putting them in a

[Tutor] Creating & Handling lots of objects

2004-12-03 Thread Matt Williams
Dear Tutor-list, I'm sorry for this appallingly dumb question, but I'm having a little problem with objects. I've written a class, with some methods. I then want to be able to call the class repeatedly, to create some objects. The number of objects, and some of their initialisation parameters nee