I wish to put the modules that I write that will be used in other Python
programs in the following directory structure:

c:\mylibrary------+
                  |
                        |
                        +-----utils--- utility modules (signon, read_ini modules)
                        |
                        |
                        |
                        +-----ACCPAC---ACCPAC classes
                        .
                        .
                        .

I created __init__.py in c:\mylibrary (contents below)

#-----------------------------------------------------
# mylibrary package
#
# package placeholder
#
#
#-----------------------------------------------------

I created __init__.py in c:\mylibrary\utils (contents below)

#-----------------------------------------------------------
# mylibrary.utils
#
# package placeholder
#
# List of all modules in this package
#
__all__ = ["signon", "read_ini", "fmt_currency"]
#------------------------------------------------------------

within Python I can type:

from mylibrary.utils import signon

and it loads the signon module.  I can type help(signon) and it displays
proper information.

Problem: When I attempt to use any imported functions I get the following error
message:

Traceback (most recent call last):
File "<interactive input>", line 1, in ?
TypeError: object is not callable: <module 'mylibrary.utils.signon' from
'c:\python21\mylibrary\utils\signon.pyc'>

I have searched high and low for what I'm missing, but I just can't seem to put
my finger on what is wrong.

Thanks in advance for any assistance.

Regards,
Larry Bates

_______________________________________________
ActivePython mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/activepython

Reply via email to