Organizing Code - Packages

Marc 'BlackJack' Rintsch bj_666 at gmx.net
Sat Sep 8 16:18:51 EDT 2007


On Sat, 08 Sep 2007 12:42:19 -0700, xkenneth wrote:

> How do import statements that are declared at the top of a python
> module work?

They import the module.  ;-)

> for instance....
> 
> from MyModule.Objects import *
> 
> class Class:
>       def function:
>            #here i cannot access the things that should have been
> imported from the above statement
>            #i printed the dir() function to verify this

Sorry I don't believe this.  This doesn't even compile because the method
`function()` lacks the arguments in the definition.  Please post actual
code and actual tracebacks you get.

And `MyModule` is a bad name for a package.

Ciao,
	Marc 'BlackJack' Rintsch



More information about the Python-list mailing list