470,647 Members | 1,131 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,647 developers. It's quick & easy.

modules and namespaces

Hello,

I thought that this will work:

#m1.py
def f1():
return string.join('a','a')

#m2.py
def f2():
return string.join('b','b')

#main.py
import string
import m1
import m2

print f1()
print f2()

---------

However it doesn't work until I import the string module into m1 and m2
modules. I found in the manual that imported modules will be searched in
the container module first. Is it more efficient to import the string
module into main and m1 and m2 than importing only into m1 and m2?

Mage
Jul 19 '05 #1
0 995

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Andy Jewell | last post: by
1 post views Thread by Dan Williams | last post: by
12 posts views Thread by qwweeeit | last post: by
5 posts views Thread by Ben R. | last post: by
5 posts views Thread by Alex | last post: by
17 posts views Thread by Neil Cerutti | last post: by
173 posts views Thread by Zytan | last post: by
2 posts views Thread by deltaquattro | last post: by
4 posts views Thread by Fabrizio Pollastri | last post: by
1 post views Thread by Korara | last post: by
reply views Thread by warner | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.