I was able to get this solved by calling class like this:<div><br></div><div><div>>>> from core.fleet import Fleet</div><div>>>> f = Fleet()</div><div><br></div><div>Thanks to a thread from the list titled "TypeError: 'module' object is not callable" </div>

<br><div class="gmail_quote">On Tue, Sep 6, 2011 at 2:02 PM, Kayode Odeyemi <span dir="ltr"><<a href="mailto:dreyemi@gmail.com">dreyemi@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

Is there anything I need to do to create an instance of a class?<div><br></div><div>I have this simple code(The class is in a package core.fleet):</div><div><br></div><div><div>class Fleet(object):</div><div>    def __init__(self):</div>


<div>        """ no-arg constructor """</div><div>    def fleet_file_upload(self, filename, type=None):</div><div>        if type == 'user':</div><div>            return 'photos/%Y/%m/%d'</div>


<div>        return 'images'</div><div><br></div><div>    def fleet_get_fleet(self):</div><div>        """ Get all fleet """</div><div>        return db.db_get_fleet()</div><div><br>

</div>
<div>    def fleet_get_fleet_type(self):</div><div>        """ Get fleet by type or category """</div><div><br></div><div>For Python shell, I did this:</div><div><br></div><div>>>> import core.fleet</div>


<div><div>>>> f = Fleet()</div><div>Traceback (most recent call last):</div><div>  File "<console>", line 1, in <module></div><div>NameError: name 'Fleet' is not defined</div></div>

<div>
<br></div><div>What am I doing wrong?</div><div><br></div><font color="#888888"><div><br></div>-- <br>Odeyemi 'Kayode O.<br><a href="http://www.sinati.com" target="_blank">http://www.sinati.com</a>. t: @charyorde<br>

<br>
</font></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br>Odeyemi 'Kayode O.<br><a href="http://www.sinati.com" target="_blank">http://www.sinati.com</a>. t: @charyorde<br><br>
</div>