I was able to get this solved by calling class like this: >>> from core.fleet import Fleet >>> f = Fleet()
Thanks to a thread from the list titled "TypeError: 'module' object is not callable" On Tue, Sep 6, 2011 at 2:02 PM, Kayode Odeyemi <drey...@gmail.com> wrote: > Is there anything I need to do to create an instance of a class? > > I have this simple code(The class is in a package core.fleet): > > class Fleet(object): > def __init__(self): > """ no-arg constructor """ > def fleet_file_upload(self, filename, type=None): > if type == 'user': > return 'photos/%Y/%m/%d' > return 'images' > > def fleet_get_fleet(self): > """ Get all fleet """ > return db.db_get_fleet() > > def fleet_get_fleet_type(self): > """ Get fleet by type or category """ > > For Python shell, I did this: > > >>> import core.fleet > >>> f = Fleet() > Traceback (most recent call last): > File "<console>", line 1, in <module> > NameError: name 'Fleet' is not defined > > What am I doing wrong? > > > -- > Odeyemi 'Kayode O. > http://www.sinati.com. t: @charyorde > > -- Odeyemi 'Kayode O. http://www.sinati.com. t: @charyorde
-- http://mail.python.org/mailman/listinfo/python-list