table dynamic programming and introspection functions syntax description __import__imports module by namesee text compile(sourcefilemodereturns the code object that results from compiling the source textfile should be the filenameor ""mode must be "single""eval"or "execdelattr(objnamedeletes the attribute called name from object obj dir(objreturns the list of names in the local scopeor if obj is given then obj' names ( its attributes and methodseval(sourceglobalslocalsexec(objglobalslocalsreturns the result of evaluating the single expression in sourceif suppliedglobals is the global context and locals is the local context (as dictionariesevaluates object objwhich can be string or code object from compile()and returns noneif suppliedglobals is the global context and locals is the local context getattr(objnamevalreturns the value of the attribute called name from object objor val if given and there is no such attribute globals(returns dictionary of the current global context hasattr(objnamereturns true if object obj has an attribute called name locals(returns dictionary of the current local context setattr(objnamevalsets the attribute called name to the value val for the object objcreating the attribute if necessary type(objreturns object obj' type object vars(objreturns object obj' context as dictionaryor the local context if obj is not given amount of code (whereas eval(evaluates single expression--see table )and raises syntaxerror exception if there' syntax error here' the second way to dynamically load module at runtime--the code shown here replaces the first approach' try except blocktryexec("import namemodules append(sys modules[name]except syntaxerror as errprint(err