import and package confusion

Dale Amon amon at vnl.com
Wed Apr 29 15:36:23 EDT 2009


I am trying to get to the heart of what it is I am
missing. Is it the case that if you have a module C in a 
package A:

	A.C

that there is no way to load it such that you can use:

	x = A.C()

in your code? This is just a simpler case of what I'm
trying to do now, which has a module C in a sub-package
to be imported:

	A.B.C

ie with files:
	mydir/A/B/C.py
	mydir/mymain.py

and executed in mymain.py as:

	x = A.B.C()

I may still chose to do it the way you suggested, but I
would still like to understand why this does not work.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 196 bytes
Desc: Digital signature
URL: <http://mail.python.org/pipermail/python-list/attachments/20090429/3d40c9ba/attachment-0001.sig>


More information about the Python-list mailing list