tags:

views:

132

answers:

2

I mean, can I create them dynamically?

+4  A: 

You can create them dynamically, with the imp.new_module method.

Ned Batchelder
+7  A: 

Yes:

>>> import types
>>> m = types.ModuleType("mymod")
>>> m
<module 'mymod' (built-in)>
RichieHindle
Ah. That's nice.
interstar