What was the line of code you tried to run interactively when you got the
error? I think that is where the problem lies, not with your organization. I
suspect you didn't actually call a function in signon. For example, did you
actually try something like:

>>> from mylibrary.utils import signon
>>> signon.myfunction()

If this didn't help, you need to let us know what signon actually contains?
If it is small enough perhaps you could paste the source in your reply.

---
Patrick K. O'Brien
Orbtech
"I am, therefore I think."

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of Larry Bates
Sent: Monday, June 25, 2001 12:59 PM
To: [EMAIL PROTECTED]
Subject: Newbie & package setup

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

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

Reply via email to