On Feb 9, 6:48 pm, "Hendrik van Rooyen" <m...@microcorp.co.za> wrote: > "cptn.spoon" <cp......@gmail.com> wrote: > > On Feb 9, 3:58 pm, Paul Rubin <http://phr...@nospam.invalid> wrote: > > >Thanks Paul! I thought this might be the case. So how would I get the > >StockMarket class instance to contain many Stock class instances and > >then be able to iterate through them? I'm guessing the basic structure > >would be as follows...but I think I'm wrong: > > >class StockMarket: > > pass > > No. > At this level, just use a list of instances of your Stock class. > > - Hendrik
How do I get a list of instances of a particular class? Is there a way to do this dynamically? Also, what would be the way of dynamically creating an instance of a class based on user input (ie a user wants to create a new instance of the Stock class via shell input)? I'm not sure if I have the wrong mindset here. Thanks for any help ~Phil -- http://mail.python.org/mailman/listinfo/python-list