import os import sys import glob import re files = glob.glob(os.path.dirname(__file__)+"/*.py") __all__ = [] initre = re.compile('__init__') for i in files: if initre.search(i): continue i = os.path.basename(i) lastDot = i.rfind(".") i = i[0:lastDot] __all__.append(i) # This line is essentially: from i import * __import__(i, locals(), globals(), ["*"]) __all__ = list(set(__all__)) # vi:tabstop=4:expandtab:autoindent # kate: indent-mode python;indent-width 4;replace-tabs on;