In Python >= 2.5, if you need to do
from . import module
but you don't know the name of module until runtime, this is how you do it:
mod = getattr(__import__('', globals(), locals(),
[name], 1), name)
(This is going on my big list of things I will change when I am the BDFL.)