print_function _feature(( 'alpha' )( 'alpha' ) sepchr seplen mydir has names to use this as tool for listing other modulessimply pass the modules in as objects to this file' function here it is listing attributes in the tkinter gui module in the standard library ( tkinter in python )it will technically work on any object with __name____file__and __dict__ attributesimport mydir import tkinter mydir listing(tkinternametkinter filec:\python \lib\tkinter\__init__ py active active all all anchor anchor arc arc at many more names omitted image_types mainloop sys wantobjects warnings tkinter has names we'll meet getattr and its relatives again later the point to notice here is that mydir is program that lets you browse other programs because python exposes its internalsyou can process objects generically importing modules by name string the module name in an import or from statement is hardcoded variable name sometimesthoughyour program will get the name of module to be imported as string at runtime--from user selection in guior parse of an xml documentfor instance unfortunatelyyou can' use import statements directly to load module given its name as string--python expects variable name that' taken literally and not evaluatednot string or expression for instance you can preload tools such as mydir listing and the reloader we'll meet in moment into the interactive namespace by importing them in the file referenced by the pythonstartup environment variable because code in the startup file runs in the interactive namespace (module __main__)importing common tools in the startup file can save you some typing see appendix for more details importing modules by name string