[Tutor] module objects

Karthik Gurumurthy karthikg@aztec.soft.net
Fri, 28 Dec 2001 17:43:17 +0530


i remember reading that a module in python is also an object.
so if i define a file test.py , i have a test module object.
i observed that sys.modules is a dict containing many modules.
if i add my module also to this dictionary what can i achieve?
i guess am not able to put it properly but my question is
that what can i do with it? some examples w'd help.

import test
import sys
sys.modules['test'] = test