In python exists "namespaces". If you import a certain module inside a class/function it will only be available in the class/function namespace:
Code:
>>> def fun():
... import os
...
>>> fun()
>>> os
Traceback (most recent call last):
File "<stdin>", line 1, in ?
NameError: name 'os' is not defined
>>>
Otherwise, if you import module in the 'global' namespace it will available for any class/module of your script:
Code:
>>> import os
>>> def fun():
... os
...
>>> os
<module 'os' from 'C:\Python24\lib\os.pyc'>
>>> fun()
>>>