Source

importsysclassStd(object):""" makes top-level python modules available as an attribute, importing them on first access. """def__init__(self):self.__dict__=sys.modulesdef__getattr__(self,name):try:m=__import__(name)exceptImportError:raiseAttributeError("py.std: could not import %s"%name)returnmstd=Std()