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
--
http://mail.python.org/mailman/listinfo/python-list