[Tutor] module imports

kevin parks kp8 at mac.com
Thu Mar 9 00:47:01 CET 2006


i have a module called foo.py

foo.py imports random

kp.py imports foo.py ... but in kp.py i also need to use stuff from 
random...

so kp.py also imports random....

but i prolly shouldn't do that right?

Cause now, haven't i needlessly copied the same 
names/attributes/methods/functions to 2 namespaces...

I get very confused about imports... and accessing names from other 
spaces and such...
and efficiency.

i have 2 or more modules all of which need to access a given function 
or method, what is the best way to do that.

i am so cornfused



More information about the Tutor mailing list