We're back after a server migration that caused effbot.org to fall over a bit harder than expected. Expect some glitches.

__import__('x.y.z') returns module 'x'; how do I get z?

Try:

__import__('x.y.z').y.z

For more realistic situations, you may have to do something like

m = __import__(s)
for i in s.split(".")[1:]:
    m = getattr(m, i)

CATEGORY: programming